]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/vf_xfade: drop unused frames from inactive inputs
authorPaul B Mahol <onemda@gmail.com>
Sun, 14 Mar 2021 12:06:50 +0000 (13:06 +0100)
committerPaul B Mahol <onemda@gmail.com>
Sun, 14 Mar 2021 12:15:21 +0000 (13:15 +0100)
libavfilter/vf_xfade.c

index 4e07d7b5252cb4108f816597c78ecfc04f1ec343..cb4fae21d9eca6a119e0ed63b548205f090bb433 100644 (file)
@@ -1851,6 +1851,11 @@ static int xfade_activate(AVFilterContext *ctx)
     FF_FILTER_FORWARD_STATUS_BACK_ALL(outlink, ctx);
 
     if (s->xfade_is_over) {
+        if (!s->eof[0]) {
+            ret = ff_inlink_consume_frame(ctx->inputs[0], &in);
+            if (ret > 0)
+                av_frame_free(&in);
+        }
         ret = ff_inlink_consume_frame(ctx->inputs[1], &in);
         if (ret < 0) {
             return ret;