From: Sebastian Dröge Date: Mon, 4 Jun 2012 07:27:35 +0000 (+0200) Subject: pad: Only forward caps events to a pad if it accepts the caps X-Git-Tag: RELEASE-0.11.92~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=991ac561e19b71ec273559ead1f78bd216202359;p=platform%2Fupstream%2Fgstreamer.git pad: Only forward caps events to a pad if it accepts the caps Fixes bug #677335. --- diff --git a/gst/gstpad.c b/gst/gstpad.c index ad44d83..1ae2dba 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -4525,7 +4525,7 @@ flushed: static GstFlowReturn pre_eventfunc_check (GstPad * pad, GstEvent * event) { - GstCaps *caps, *templ; + GstCaps *caps; switch (GST_EVENT_TYPE (event)) { case GST_EVENT_CAPS: @@ -4533,12 +4533,8 @@ pre_eventfunc_check (GstPad * pad, GstEvent * event) /* backwards compatibility mode for caps */ gst_event_parse_caps (event, &caps); - /* See if pad accepts the caps */ - templ = gst_pad_get_pad_template_caps (pad); - if (!gst_caps_is_subset (caps, templ)) + if (!gst_pad_query_accept_caps (pad, caps)) goto not_accepted; - - gst_caps_unref (templ); break; } default: @@ -4549,11 +4545,8 @@ pre_eventfunc_check (GstPad * pad, GstEvent * event) /* ERRORS */ not_accepted: { - gst_caps_unref (templ); GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, pad, "caps %" GST_PTR_FORMAT " not accepted", caps); - GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, pad, - "no intersection with template %" GST_PTR_FORMAT, templ); return GST_FLOW_NOT_NEGOTIATED; } }