summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2016-05-14 23:36:43 +1000
committerJan Schmidt <jan@centricular.com>2016-05-16 20:58:13 +1000
commit7c65287c03646fa73819262a05f30acb47871d38 (patch)
tree3947219f4ed08278c60a6ccda688f5528638374a
parent1592f5354b0153a5b7fbbc4d845e4ee2c1ddde1c (diff)
downloadgstreamer-7c65287c03646fa73819262a05f30acb47871d38.tar.gz
bin: Fix EOS forwarding on PLAYING->PLAYING
When doing a transition from PLAYING to PLAYING, we will fail to forward an EOS message on the bus, and noone else will ever send it because there'll be no actual state changed message. Allow EOS through directly in that case.
-rw-r--r--gst/gstbin.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gst/gstbin.c b/gst/gstbin.c
index 4fb1cd9f23..9601b8ebba 100644
--- a/gst/gstbin.c
+++ b/gst/gstbin.c
@@ -3336,10 +3336,12 @@ bin_do_eos (GstBin * bin)
GST_OBJECT_LOCK (bin);
/* If all sinks are EOS, we're in PLAYING and no state change is pending
- * we forward the EOS message to the parent bin or application
+ * (or we're doing playing to playing and noone else will trigger posting
+ * EOS for us) we forward the EOS message to the parent bin or application
*/
eos = GST_STATE (bin) == GST_STATE_PLAYING
- && GST_STATE_PENDING (bin) == GST_STATE_VOID_PENDING
+ && (GST_STATE_PENDING (bin) == GST_STATE_VOID_PENDING ||
+ GST_STATE_PENDING (bin) == GST_STATE_PLAYING)
&& bin->priv->posted_playing && is_eos (bin, &seqnum);
GST_OBJECT_UNLOCK (bin);
@@ -3362,6 +3364,9 @@ bin_do_eos (GstBin * bin)
GST_DEBUG_OBJECT (bin,
"all sinks posted EOS, posting seqnum #%" G_GUINT32_FORMAT, seqnum);
gst_element_post_message (GST_ELEMENT_CAST (bin), tmessage);
+ } else {
+ GST_LOG_OBJECT (bin, "Not forwarding EOS due to in progress state change, "
+ " or already posted, or waiting for more EOS");
}
}