From 8e75bea378994efc552df05fa72d7941324261c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Fri, 13 Nov 2015 17:14:14 -0500 Subject: [PATCH] autoconvert: Always give a valid reply to internal caps queries Caps queries can always have a valid reply, either the filter or ANY. If the caps are ANY, then accept-caps always returns TRUE. --- gst/autoconvert/gstautoconvert.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/gst/autoconvert/gstautoconvert.c b/gst/autoconvert/gstautoconvert.c index 230a15c0a7..5fdb32ca20 100644 --- a/gst/autoconvert/gstautoconvert.c +++ b/gst/autoconvert/gstautoconvert.c @@ -1243,7 +1243,31 @@ gst_auto_convert_internal_sink_query (GstPad * pad, GstObject * parent, GST_AUTO_CONVERT (g_object_get_qdata (G_OBJECT (pad), parent_quark)); - return gst_pad_peer_query (autoconvert->srcpad, query); + if (!gst_pad_peer_query (autoconvert->srcpad, query)) { + switch (GST_QUERY_TYPE (query)) { + case GST_QUERY_CAPS: + { + GstCaps *filter; + + gst_query_parse_caps (query, &filter); + if (filter) { + gst_query_set_caps_result (query, filter); + } else { + filter = gst_caps_new_any (); + gst_query_set_caps_result (query, filter); + gst_caps_unref (filter); + } + return TRUE; + } + case GST_QUERY_ACCEPT_CAPS: + gst_query_set_accept_caps_result (query, TRUE); + return TRUE; + default: + return FALSE; + } + } + + return TRUE; } static gboolean -- 2.34.1