mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
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.
This commit is contained in:
parent
d65d8657e6
commit
8e75bea378
1 changed files with 25 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue