[FFmpeg-devel] [PATCH 06/12] avfilter/avfilter: make filter_activate_default request frames on behalf of sinks
Marton Balint
cus at passwd.hu
Tue Jun 24 22:23:04 EEST 2025
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 <cus at passwd.hu>
---
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)
--
2.43.0
More information about the ffmpeg-devel
mailing list