From d36661340100fa2bed8760386c0f7c90ab6afa50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 28 May 2013 13:06:15 +0200 Subject: [PATCH] decodebin: Block on serialized queries too Otherwise we will only block after the serialized, non-sticky event after the CAPS event or the first buffer. If we're waiting for another pad to finish autoplugging after we got final caps on this pad, it will mean that we will let the ALLOCATION query pass although the pad is not exposed yet. --- gst/playback/gstdecodebin2.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 3b5479854c..051d970ce2 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -4107,6 +4107,15 @@ source_pad_blocked_cb (GstPad * pad, GstPadProbeInfo * info, gpointer user_data) goto done; } } + } else if (GST_PAD_PROBE_INFO_TYPE (info) & + GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM) { + GstQuery *query = GST_PAD_PROBE_INFO_QUERY (info); + + if (!GST_QUERY_IS_SERIALIZED (query)) { + /* do not block on non-serialized queries */ + GST_LOG_OBJECT (pad, "Letting non-serialized query through"); + return GST_PAD_PROBE_PASS; + } } chain = dpad->chain; dbin = chain->dbin; @@ -4174,9 +4183,10 @@ gst_decode_pad_set_blocked (GstDecodePad * dpad, gboolean blocked) if (blocked) { if (dpad->block_id == 0) dpad->block_id = - gst_pad_add_probe (opad, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM, - source_pad_blocked_cb, gst_object_ref (dpad), - (GDestroyNotify) gst_object_unref); + gst_pad_add_probe (opad, + GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM | + GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM, source_pad_blocked_cb, + gst_object_ref (dpad), (GDestroyNotify) gst_object_unref); } else { if (dpad->block_id != 0) { gst_pad_remove_probe (opad, dpad->block_id);