[FFmpeg-cvslog] avfilter/af_dynaudnorm: do not hang forever if only EOF is received

Paul B Mahol git at videolan.org
Wed Jan 1 14:44:42 EET 2020


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Jan  1 13:35:31 2020 +0100| [d4d6280ab2e8552dfad0a7d1f0dd2c440192e97f] | committer: Paul B Mahol

avfilter/af_dynaudnorm: do not hang forever if only EOF is received

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

 libavfilter/af_dynaudnorm.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/libavfilter/af_dynaudnorm.c b/libavfilter/af_dynaudnorm.c
index bc573d3482..2283fafb14 100644
--- a/libavfilter/af_dynaudnorm.c
+++ b/libavfilter/af_dynaudnorm.c
@@ -67,7 +67,6 @@ typedef struct DynamicAudioNormalizerContext {
     double *weights;
 
     int channels;
-    int delay;
     int eof;
     int64_t pts;
 
@@ -345,7 +344,6 @@ static int config_input(AVFilterLink *inlink)
     init_gaussian_filter(s);
 
     s->channels = inlink->channels;
-    s->delay = s->filter_size;
 
     return 0;
 }
@@ -717,7 +715,6 @@ static int flush_buffer(DynamicAudioNormalizerContext *s, AVFilterLink *inlink,
         }
     }
 
-    s->delay--;
     return filter_frame(inlink, out);
 }
 
@@ -734,7 +731,6 @@ static int flush(AVFilterLink *outlink)
 
         s->pts = out->pts;
         ret = ff_filter_frame(outlink, out);
-        s->delay = s->queue.available;
     }
 
     return ret;
@@ -772,10 +768,10 @@ static int activate(AVFilterContext *ctx)
             s->eof = 1;
     }
 
-    if (s->eof && s->delay > 0)
+    if (s->eof && s->queue.available)
         return flush(outlink);
 
-    if (s->eof && s->delay <= 0) {
+    if (s->eof && !s->queue.available) {
         ff_outlink_set_status(outlink, AVERROR_EOF, s->pts);
         return 0;
     }



More information about the ffmpeg-cvslog mailing list