From: Sebastian Dröge Date: Fri, 6 Jul 2018 07:51:37 +0000 (+0300) Subject: parsebin: Don't try to continue autoplugging a parser if we got raw caps X-Git-Tag: 1.19.3~511^2~1603 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=268c5e7e1728e2a0d9470a120e9f9c8e39ffb524;p=platform%2Fupstream%2Fgstreamer.git parsebin: Don't try to continue autoplugging a parser if we got raw caps Otherwise we'll fail with an unhelpful message that no decoder for the raw caps was found if a container contains raw media. --- diff --git a/gst/playback/gstparsebin.c b/gst/playback/gstparsebin.c index aee542c..d8fc232 100644 --- a/gst/playback/gstparsebin.c +++ b/gst/playback/gstparsebin.c @@ -106,6 +106,7 @@ #include "gstplay-enum.h" #include "gstplayback.h" #include "gstplaybackutils.h" +#include "gstrawcaps.h" /* generic templates */ static GstStaticPadTemplate parse_bin_sink_template = @@ -1103,9 +1104,18 @@ static gboolean gst_parse_bin_autoplug_continue (GstElement * element, GstPad * pad, GstCaps * caps) { + static GstStaticCaps raw_caps = GST_STATIC_CAPS (DEFAULT_RAW_CAPS); + + GST_DEBUG_OBJECT (element, "caps %" GST_PTR_FORMAT, caps); + + /* If it matches our target caps, expose it */ + if (gst_caps_can_intersect (caps, gst_static_caps_get (&raw_caps))) { + GST_DEBUG_OBJECT (element, "autoplug-continue returns FALSE"); + return FALSE; + } + GST_DEBUG_OBJECT (element, "autoplug-continue returns TRUE"); - /* by default we always continue */ return TRUE; }