From 7b547e044cb8c42d83a06cc23f4a44970301c166 Mon Sep 17 00:00:00 2001 From: Elliot Chen Date: Mon, 27 May 2024 15:41:23 +0900 Subject: [PATCH] autovideoconvert: should not forward the allocation query if no element is selected Part-of: --- .../gst/autoconvert/gstbaseautoconvert.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/subprojects/gst-plugins-bad/gst/autoconvert/gstbaseautoconvert.c b/subprojects/gst-plugins-bad/gst/autoconvert/gstbaseautoconvert.c index eecc493056..b928c115fb 100644 --- a/subprojects/gst-plugins-bad/gst/autoconvert/gstbaseautoconvert.c +++ b/subprojects/gst-plugins-bad/gst/autoconvert/gstbaseautoconvert.c @@ -1150,6 +1150,16 @@ gst_base_auto_convert_sink_query (GstPad * pad, GstObject * parent, 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: if (GST_QUERY_TYPE (query) == GST_QUERY_ACCEPT_CAPS) {