[FFmpeg-cvslog] avfilter/af_afade: check for eof after crossfade later

Paul B Mahol git at videolan.org
Wed Oct 30 20:09:17 EET 2019


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Oct 30 19:07:19 2019 +0100| [89389b7ed47b70f98d27b84e2aae3343d92d9682] | committer: Paul B Mahol

avfilter/af_afade: check for eof after crossfade later

Fixes memleaks and #8346

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

 libavfilter/af_afade.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavfilter/af_afade.c b/libavfilter/af_afade.c
index 10505caf1f..23608fb59b 100644
--- a/libavfilter/af_afade.c
+++ b/libavfilter/af_afade.c
@@ -454,7 +454,12 @@ static int activate(AVFilterContext *ctx)
 
     if (s->crossfade_is_over) {
         ret = ff_inlink_consume_frame(ctx->inputs[1], &in);
-        if (ret < 0) {
+        if (ret > 0) {
+            in->pts = s->pts;
+            s->pts += av_rescale_q(in->nb_samples,
+                      (AVRational){ 1, outlink->sample_rate }, outlink->time_base);
+            return ff_filter_frame(outlink, in);
+        } else if (ret < 0) {
             return ret;
         } else if (ff_inlink_acknowledge_status(ctx->inputs[1], &status, &pts)) {
             ff_outlink_set_status(ctx->outputs[0], status, pts);
@@ -464,11 +469,6 @@ static int activate(AVFilterContext *ctx)
                 ff_inlink_request_frame(ctx->inputs[1]);
                 return 0;
             }
-        } else {
-            in->pts = s->pts;
-            s->pts += av_rescale_q(in->nb_samples,
-                      (AVRational){ 1, outlink->sample_rate }, outlink->time_base);
-            return ff_filter_frame(outlink, in);
         }
     }
 



More information about the ffmpeg-cvslog mailing list