[FFmpeg-cvslog] avfilter/vf_xfade: send EOF to first input early

Paul B Mahol git at videolan.org
Mon May 22 18:09:14 EEST 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon May 22 16:54:44 2023 +0200| [c37cf59c5bbad7cedf288b2dc198c928acd397fa] | committer: Paul B Mahol

avfilter/vf_xfade: send EOF to first input early

No point to consume 1st input frames any more after crossfade is over.

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

 libavfilter/vf_xfade.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_xfade.c b/libavfilter/vf_xfade.c
index a0e2e61d40..a13a7db627 100644
--- a/libavfilter/vf_xfade.c
+++ b/libavfilter/vf_xfade.c
@@ -2067,9 +2067,13 @@ static int xfade_activate(AVFilterContext *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);
+            if (ff_inlink_queued_frames(ctx->inputs[0]) > 0) {
+                ret = ff_inlink_consume_frame(ctx->inputs[0], &in);
+                if (ret > 0)
+                    av_frame_free(&in);
+            }
+            ff_inlink_set_status(ctx->inputs[0], AVERROR_EOF);
+            s->eof[0] = 1;
         }
         ret = ff_inlink_consume_frame(ctx->inputs[1], &in);
         if (ret < 0) {



More information about the ffmpeg-cvslog mailing list