From: Sebastian Dröge Date: Thu, 22 Nov 2012 12:06:14 +0000 (+0100) Subject: decodebin: Check if the element really accepts the caps after setting it to READY X-Git-Tag: 1.19.3~511^2~5711 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2faef82b9ae79fbd249c1eb5d30236d55d3930a7;p=platform%2Fupstream%2Fgstreamer.git decodebin: Check if the element really accepts the caps after setting it to READY It might know the caps constraints for sure only after opening a decoder. --- diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index c26887e..9d40db5 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -2009,6 +2009,16 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad, /* Stop filtering errors. */ remove_error_filter (dbin, element); + /* check if we still accept the caps on the pad after setting + * the element to READY */ + if (!gst_pad_query_accept_caps (sinkpad, caps)) { + GST_WARNING_OBJECT (dbin, "Element %s does not accept caps", + GST_ELEMENT_NAME (element)); + gst_object_unref (sinkpad); + gst_bin_remove (GST_BIN (dbin), element); + continue; + } + gst_object_unref (sinkpad); GST_LOG_OBJECT (dbin, "linked on pad %s:%s", GST_DEBUG_PAD_NAME (pad)); @@ -3285,7 +3295,7 @@ drain_and_switch_chains (GstDecodeChain * chain, GstDecodePad * drainpad, if (G_UNLIKELY (chain->drained)) { goto beach; } - + if (chain->endpad) { /* Check if we're reached the target endchain */ if (chain == drainpad->chain) { @@ -3326,7 +3336,7 @@ drain_and_switch_chains (GstDecodeChain * chain, GstDecodePad * drainpad, } else { GST_DEBUG ("Group %p was the last in chain %p", chain->active_group, chain); - chain->drained = TRUE; + chain->drained = TRUE; /* We're drained ! */ } }