autoconvert: Look at all possibilities for accept-caps even if there is a selected subelement

If the accept-caps succeeds with a different subelement, then the subsequent
caps event will change the current subelement.
This commit is contained in:
Olivier Crête 2012-09-11 18:53:43 -04:00
parent 60739b828d
commit 977f84d272

View file

@ -1039,7 +1039,19 @@ gst_auto_convert_sink_query (GstPad * pad, GstObject * parent, GstQuery * query)
gst_object_unref (sub_sinkpad); gst_object_unref (sub_sinkpad);
gst_object_unref (subelement); gst_object_unref (subelement);
} else {
if (ret && GST_QUERY_TYPE (query) == GST_QUERY_ACCEPT_CAPS) {
gboolean res;
gst_query_parse_accept_caps_result (query, &res);
if (!res)
goto ignore_acceptcaps_failure;
}
return ret;
}
ignore_acceptcaps_failure:
if (GST_QUERY_TYPE (query) == GST_QUERY_ACCEPT_CAPS) { if (GST_QUERY_TYPE (query) == GST_QUERY_ACCEPT_CAPS) {
GstCaps *caps; GstCaps *caps;
GstCaps *accept_caps; GstCaps *accept_caps;
@ -1057,10 +1069,7 @@ gst_auto_convert_sink_query (GstPad * pad, GstObject * parent, GstQuery * query)
GST_WARNING_OBJECT (autoconvert, "Got query %s while no element was" GST_WARNING_OBJECT (autoconvert, "Got query %s while no element was"
" selected, letting through", " selected, letting through",
gst_query_type_get_name (GST_QUERY_TYPE (query))); gst_query_type_get_name (GST_QUERY_TYPE (query)));
ret = gst_pad_peer_query (autoconvert->srcpad, query); return gst_pad_peer_query (autoconvert->srcpad, query);
}
return ret;
} }
/** /**