From: Sebastian Dröge Date: Thu, 10 Jul 2014 10:17:52 +0000 (+0200) Subject: decodebin: Only continue autoplugging once the pad has final caps X-Git-Tag: 1.6.0~1104 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f66555668aeb42b41d3f1288a1e503f92e2781fc;p=platform%2Fupstream%2Fgst-plugins-base.git decodebin: Only continue autoplugging once the pad has final caps If the caps query returned us fixed caps this doesn't mean yet that these caps are actually complete (fields might be missing). It allows to do us some decisions, but the selection of the next element should be delayed as only complete caps allow proper selection of the next element. --- diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index f1920a2..623aac4 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -1577,8 +1577,16 @@ analyze_new_pad (GstDecodeBin * dbin, GstElement * src, GstPad * pad, /* 1.c when the caps are not fixed yet, we can't be sure what element to * connect. We delay autoplugging until the caps are fixed */ - if (!is_parser_converter && !gst_caps_is_fixed (caps)) + if (!is_parser_converter && !gst_caps_is_fixed (caps)) { goto non_fixed; + } else if (!is_parser_converter) { + gst_caps_unref (caps); + caps = gst_pad_get_current_caps (pad); + if (!caps) { + GST_DEBUG_OBJECT (dbin, "No final caps set yet, delaying autoplugging"); + goto setup_caps_delay; + } + } /* 1.d else get the factories and if there's no compatible factory goto * unknown_type */ @@ -1734,11 +1742,11 @@ analyze_new_pad (GstDecodeBin * dbin, GstElement * src, GstPad * pad, pad = p; gst_caps_unref (caps); - caps = get_pad_caps (pad); - if (!gst_caps_is_fixed (caps)) { - g_value_array_free (factories); - goto non_fixed; + caps = gst_pad_get_current_caps (pad); + if (!caps) { + GST_DEBUG_OBJECT (dbin, "No final caps set yet, delaying autoplugging"); + goto setup_caps_delay; } }