From 44546751db824002f07cc0b8b2fc62587a5a34b5 Mon Sep 17 00:00:00 2001 From: Marton Balint Date: Sun, 22 Jun 2025 20:48:09 +0200 Subject: [PATCH] avfilter/avfilter: make filter_activate_default request frames on behalf of sinks Sinks without an activate callback have no means to request frames in their input, therefore the default activate callback should do it for them. Fixes ticket #11624. Fixes ticket #10988. Fixes ticket #10990. Signed-off-by: Marton Balint --- libavfilter/avfilter.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index e03dc65fc6..5bcf0b4ef7 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -1288,6 +1288,10 @@ static int filter_activate_default(AVFilterContext *filter) if (li->frame_wanted_out) return request_frame_to_filter(filter->outputs[i]); } + if (!filter->nb_outputs) { + ff_inlink_request_frame(filter->inputs[0]); + return 0; + } return FFERROR_NOT_READY; } @@ -1427,6 +1431,11 @@ static int filter_activate_default(AVFilterContext *filter) Rationale: even if all inputs are blocked an activate callback should request a frame on some if its inputs if a frame is requested on any of its output. + + - Request a frame on the input for sinks. + + Rationale: sinks using the old api have no way to request a frame on their + input, so we need to do it for them. */ int ff_filter_activate(AVFilterContext *filter)