diff mbox series

[FFmpeg-devel] avfilter/vf_fps: only give frame as soon as possible if really requested by output

Message ID 20220219010025.153329-1-onemda@gmail.com
State New
Headers show
Series [FFmpeg-devel] avfilter/vf_fps: only give frame as soon as possible if really requested by output | expand

Checks

Context Check Description
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 success Make fate finished
andriy/make_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson success Make fate finished

Commit Message

Paul B Mahol Feb. 19, 2022, 1 a.m. UTC
Fixes OOM in #9081.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavfilter/vf_fps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nicolas George Feb. 19, 2022, 1:58 p.m. UTC | #1
Paul B Mahol (12022-02-19):
> Fixes OOM in #9081.
> 
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavfilter/vf_fps.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This would break input-driven filtering I think. I am looking into it.

Regards,
Nicolas George Feb. 19, 2022, 4:03 p.m. UTC | #2
Nicolas George (12022-02-19):
> This would break input-driven filtering I think. I am looking into it.

See:

https://ffmpeg.org/pipermail/ffmpeg-devel/2022-February/293240.html
https://ffmpeg.org/pipermail/ffmpeg-devel/2022-February/293241.html

Regards,
diff mbox series

Patch

diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
index 99e679441e..1a68d519fb 100644
--- a/libavfilter/vf_fps.c
+++ b/libavfilter/vf_fps.c
@@ -351,7 +351,7 @@  static int activate(AVFilterContext *ctx)
     if (s->frames_count > 0) {
         ret = write_frame(ctx, s, outlink, &again);
         /* Couldn't generate a frame, so schedule us to perform another step */
-        if (again)
+        if (again && ff_outlink_frame_wanted(outlink))
             ff_filter_set_ready(ctx, 100);
         return ret;
     }