[FFmpeg-cvslog] avfilter/avf_ahistogram: request new frames only when needed

Paul B Mahol git at videolan.org
Mon May 9 23:21:16 EEST 2022


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Apr 30 16:33:07 2022 +0200| [36c274057a9157c8a6a7335dca8ac82678a25b63] | committer: Paul B Mahol

avfilter/avf_ahistogram: request new frames only when needed

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=36c274057a9157c8a6a7335dca8ac82678a25b63
---

 libavfilter/avf_ahistogram.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavfilter/avf_ahistogram.c b/libavfilter/avf_ahistogram.c
index 4f2059f26e..d14e0bcfac 100644
--- a/libavfilter/avf_ahistogram.c
+++ b/libavfilter/avf_ahistogram.c
@@ -436,6 +436,11 @@ static int activate(AVFilterContext *ctx)
     if (ret > 0)
         return filter_frame(inlink, in);
 
+    if (ff_inlink_queued_samples(inlink) >= s->nb_samples) {
+        ff_filter_set_ready(ctx, 10);
+        return 0;
+    }
+
     FF_FILTER_FORWARD_STATUS(inlink, outlink);
     FF_FILTER_FORWARD_WANTED(outlink, inlink);
 



More information about the ffmpeg-cvslog mailing list