[FFmpeg-cvslog] avfilter/af_afir: do not use ff_outlink_get_status() on inlinks

Paul B Mahol git at videolan.org
Tue May 30 15:02:51 EEST 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue May 30 14:06:40 2023 +0200| [447bdddeacf5111e1e47c91c9fdf9ebef29c1b70] | committer: Paul B Mahol

avfilter/af_afir: do not use ff_outlink_get_status() on inlinks

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

 libavfilter/af_afir.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/libavfilter/af_afir.c b/libavfilter/af_afir.c
index e2cb14aba5..502e544687 100644
--- a/libavfilter/af_afir.c
+++ b/libavfilter/af_afir.c
@@ -445,7 +445,7 @@ skip:
     return 0;
 }
 
-static int check_ir(AVFilterLink *link)
+static int check_ir(AVFilterLink *link, int selir)
 {
     AVFilterContext *ctx = link->dst;
     AudioFIRContext *s = ctx->priv;
@@ -458,6 +458,9 @@ static int check_ir(AVFilterLink *link)
         return AVERROR(EINVAL);
     }
 
+    if (ff_inlink_check_available_samples(link, nb_taps + 1) == 1)
+        s->eof_coeffs[selir] = 1;
+
     return 0;
 }
 
@@ -480,13 +483,10 @@ static int activate(AVFilterContext *ctx)
             continue;
 
         if (!s->eof_coeffs[selir]) {
-            ret = check_ir(ctx->inputs[1 + selir]);
+            ret = check_ir(ctx->inputs[1 + selir], selir);
             if (ret < 0)
                 return ret;
 
-            if (ff_outlink_get_status(ctx->inputs[1 + selir]) == AVERROR_EOF)
-                s->eof_coeffs[selir] = 1;
-
             if (!s->eof_coeffs[selir]) {
                 if (ff_outlink_frame_wanted(ctx->outputs[0]))
                     ff_inlink_request_frame(ctx->inputs[1 + selir]);
@@ -543,15 +543,13 @@ static int activate(AVFilterContext *ctx)
         }
     }
 
-    if (ff_outlink_frame_wanted(ctx->outputs[0]) &&
-        !ff_outlink_get_status(ctx->inputs[0])) {
+    if (ff_outlink_frame_wanted(ctx->outputs[0])) {
         ff_inlink_request_frame(ctx->inputs[0]);
         return 0;
     }
 
     if (s->response &&
-        ff_outlink_frame_wanted(ctx->outputs[1]) &&
-        !ff_outlink_get_status(ctx->inputs[0])) {
+        ff_outlink_frame_wanted(ctx->outputs[1])) {
         ff_inlink_request_frame(ctx->inputs[0]);
         return 0;
     }



More information about the ffmpeg-cvslog mailing list