From ec7a7c318ac33fe76ad88fde7b9b64913ab23c57 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Thu, 2 Feb 2012 17:18:22 +0000 Subject: [PATCH] bin: reset the EOS detection machinery after sending an EOS message This will allow detecting further EOS, for instance after looping a stream without changing states. https://bugzilla.gnome.org/show_bug.cgi?id=668289 --- gst/gstbin.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gst/gstbin.c b/gst/gstbin.c index f3d1b56686..479917f868 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -3051,6 +3051,16 @@ bin_do_eos (GstBin * bin) && g_atomic_int_compare_and_exchange (&bin->priv->posted_eos, FALSE, TRUE)) { GstMessage *tmessage; + + /* Clear out any further messages, and reset posted_eos so we can + detect any new EOS that happens (eg, after a seek). Since all + sinks have now posted an EOS, there will be no further EOS events + seen unless there is a new logical EOS */ + GST_OBJECT_LOCK (bin); + bin_remove_messages (bin, NULL, GST_MESSAGE_EOS); + bin->priv->posted_eos = FALSE; + GST_OBJECT_UNLOCK (bin); + tmessage = gst_message_new_eos (GST_OBJECT_CAST (bin)); gst_message_set_seqnum (tmessage, seqnum); GST_DEBUG_OBJECT (bin,