autovideoconvert: should not forward the allocation query if no element is selected

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6927>
This commit is contained in:
Elliot Chen 2024-05-27 15:41:23 +09:00 committed by GStreamer Marge Bot
parent b792b558ce
commit 7b547e044c

View file

@ -1150,6 +1150,16 @@ gst_base_auto_convert_sink_query (GstPad * pad, GstObject * parent,
return ret; return ret;
} }
/* Should not forward the allocation query downstream directly
* if no subelement is selected, otherwise it can influence
* the downstream allocation choices and upstream buffer usage.
*/
if (GST_QUERY_TYPE (query) == GST_QUERY_ALLOCATION) {
GST_DEBUG_OBJECT (self,
"no subelement is selected yet, can't answer ALLOCATION query");
return FALSE;
}
ignore_acceptcaps_failure: ignore_acceptcaps_failure:
if (GST_QUERY_TYPE (query) == GST_QUERY_ACCEPT_CAPS) { if (GST_QUERY_TYPE (query) == GST_QUERY_ACCEPT_CAPS) {