From 8e114c427aebadec0c5f11834110ad884805a7ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 20 Sep 2011 14:03:47 +0200 Subject: [PATCH] decodebin2: Only call autoplug-continue with fixed caps With unfixed caps we can't reliably decide if the final caps are going to be "raw" (e.g. supported by a sink) or not. We will get here again later when the caps are fixed. --- gst/playback/gstdecodebin2.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 158d6e6f22..bf88ed8148 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -1423,10 +1423,17 @@ analyze_new_pad (GstDecodeBin * dbin, GstElement * src, GstPad * pad, dpad = gst_decode_pad_new (dbin, pad, chain); /* 1. Emit 'autoplug-continue' the result will tell us if this pads needs - * further autoplugging. */ - g_signal_emit (G_OBJECT (dbin), - gst_decode_bin_signals[SIGNAL_AUTOPLUG_CONTINUE], 0, dpad, caps, - &apcontinue); + * further autoplugging. Only do this for fixed caps, for unfixed caps + * we will later come here again from the notify::caps handler. The + * problem with unfixed caps is that we can reliably tell if the output + * is e.g. accepted by a sink because only parts of the possible final + * caps might be accepted by the sink. */ + if (gst_caps_is_fixed (caps)) + g_signal_emit (G_OBJECT (dbin), + gst_decode_bin_signals[SIGNAL_AUTOPLUG_CONTINUE], 0, dpad, caps, + &apcontinue); + else + apcontinue = TRUE; /* 1.a if autoplug-continue is FALSE or caps is a raw format, goto pad_is_final */ if ((!apcontinue) || are_final_caps (dbin, caps))