diff --git a/gst/autoconvert/gstautoconvert.c b/gst/autoconvert/gstautoconvert.c index 8ba5963c73..5b11042a66 100644 --- a/gst/autoconvert/gstautoconvert.c +++ b/gst/autoconvert/gstautoconvert.c @@ -1039,28 +1039,37 @@ gst_auto_convert_sink_query (GstPad * pad, GstObject * parent, GstQuery * query) gst_object_unref (sub_sinkpad); gst_object_unref (subelement); - } else { - if (GST_QUERY_TYPE (query) == GST_QUERY_ACCEPT_CAPS) { - GstCaps *caps; - GstCaps *accept_caps; - gst_query_parse_accept_caps (query, &accept_caps); + if (ret && GST_QUERY_TYPE (query) == GST_QUERY_ACCEPT_CAPS) { + gboolean res; + gst_query_parse_accept_caps_result (query, &res); - caps = gst_auto_convert_getcaps (autoconvert, accept_caps, GST_PAD_SINK); - gst_query_set_accept_caps_result (query, - gst_caps_can_intersect (caps, accept_caps)); - gst_caps_unref (caps); - - return TRUE; + if (!res) + goto ignore_acceptcaps_failure; } - - GST_WARNING_OBJECT (autoconvert, "Got query %s while no element was" - " selected, letting through", - gst_query_type_get_name (GST_QUERY_TYPE (query))); - ret = gst_pad_peer_query (autoconvert->srcpad, query); + return ret; } - return ret; +ignore_acceptcaps_failure: + + if (GST_QUERY_TYPE (query) == GST_QUERY_ACCEPT_CAPS) { + GstCaps *caps; + GstCaps *accept_caps; + + gst_query_parse_accept_caps (query, &accept_caps); + + caps = gst_auto_convert_getcaps (autoconvert, accept_caps, GST_PAD_SINK); + gst_query_set_accept_caps_result (query, + gst_caps_can_intersect (caps, accept_caps)); + gst_caps_unref (caps); + + return TRUE; + } + + GST_WARNING_OBJECT (autoconvert, "Got query %s while no element was" + " selected, letting through", + gst_query_type_get_name (GST_QUERY_TYPE (query))); + return gst_pad_peer_query (autoconvert->srcpad, query); } /**