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
This commit is contained in:
Vincent Penquerc'h 2012-02-02 17:18:22 +00:00
parent 1f1f6e0ed5
commit ec7a7c318a

View file

@ -3051,6 +3051,16 @@ bin_do_eos (GstBin * bin)
&& g_atomic_int_compare_and_exchange (&bin->priv->posted_eos, FALSE, && g_atomic_int_compare_and_exchange (&bin->priv->posted_eos, FALSE,
TRUE)) { TRUE)) {
GstMessage *tmessage; 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)); tmessage = gst_message_new_eos (GST_OBJECT_CAST (bin));
gst_message_set_seqnum (tmessage, seqnum); gst_message_set_seqnum (tmessage, seqnum);
GST_DEBUG_OBJECT (bin, GST_DEBUG_OBJECT (bin,