From 7316a88387e3e5a36d792f4a6e95cbb9f05e9513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 12 May 2011 16:48:41 +0200 Subject: [PATCH] bin: Don't interprete pipelines without sink elements as always being in EOS state Some tests (e.g. elements/capsfilter) have pipelines with dangling sinkpads and without a sink element. These pipelines can never post an EOS message (because this is only valid by a sink) and as such should never get an EOS message posted by the bin. --- gst/gstbin.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gst/gstbin.c b/gst/gstbin.c index 947bd10792..89ad34e721 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -996,6 +996,7 @@ static gboolean is_eos (GstBin * bin, guint32 * seqnum) { gboolean result; + gint n_eos = 0; GList *walk, *msgs; result = TRUE; @@ -1009,6 +1010,7 @@ is_eos (GstBin * bin, guint32 * seqnum) find_message (bin, GST_OBJECT_CAST (element), GST_MESSAGE_EOS))) { GST_DEBUG ("sink '%s' posted EOS", GST_ELEMENT_NAME (element)); *seqnum = gst_message_get_seqnum (GST_MESSAGE_CAST (msgs->data)); + n_eos++; } else { GST_DEBUG ("sink '%s' did not post EOS yet", GST_ELEMENT_NAME (element)); @@ -1017,7 +1019,13 @@ is_eos (GstBin * bin, guint32 * seqnum) } } } - return result; + /* FIXME: Some tests (e.g. elements/capsfilter) use + * pipelines with a dangling sinkpad but no sink element. + * These tests assume that no EOS message is ever + * posted on the bus so let's keep that behaviour. + * In valid pipelines this doesn't make a difference. + */ + return result && n_eos > 0; } static void