aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_xfade.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2020-08-30 11:07:51 +0200
committerPaul B Mahol <onemda@gmail.com>2020-08-30 11:28:28 +0200
commit60796d22f9a74625bcb823c50b2406cd764726d5 (patch)
tree95d9114579400b725d4eb16cdcfef0cee5ddc861 /libavfilter/vf_xfade.c
parent9372eb00c8a1d4f2f1a356609bdcec207063baf5 (diff)
downloadffmpeg-60796d22f9a74625bcb823c50b2406cd764726d5.tar.gz
avfilter/vf_xfade: fix excessive number of queued frames
Also do not abort in some cases too early when transition is over. Fixes #8823.
Diffstat (limited to 'libavfilter/vf_xfade.c')
-rw-r--r--libavfilter/vf_xfade.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/libavfilter/vf_xfade.c b/libavfilter/vf_xfade.c
index adfcd759a8..7412709587 100644
--- a/libavfilter/vf_xfade.c
+++ b/libavfilter/vf_xfade.c
@@ -1779,10 +1779,9 @@ static int xfade_activate(AVFilterContext *ctx)
ff_outlink_set_status(outlink, status, s->pts);
return 0;
} else if (!ret) {
- if (ff_outlink_frame_wanted(outlink)) {
+ if (ff_outlink_frame_wanted(outlink))
ff_inlink_request_frame(ctx->inputs[1]);
- return 0;
- }
+ return 0;
}
}
@@ -1832,14 +1831,17 @@ static int xfade_activate(AVFilterContext *ctx)
if (!s->eof[1] && ff_outlink_get_status(ctx->inputs[1])) {
s->eof[1] = 1;
}
- if (!s->eof[0] && !s->xf[0])
+ if (!s->eof[0] && !s->xf[0] && ff_inlink_queued_frames(ctx->inputs[0]) == 0)
ff_inlink_request_frame(ctx->inputs[0]);
- if (!s->eof[1] && (s->need_second || s->eof[0]))
+ if (!s->eof[1] && (s->need_second || s->eof[0]) && ff_inlink_queued_frames(ctx->inputs[1]) == 0)
ff_inlink_request_frame(ctx->inputs[1]);
if (s->eof[0] && s->eof[1] && (
- ff_inlink_queued_frames(ctx->inputs[0]) <= 0 ||
- ff_inlink_queued_frames(ctx->inputs[1]) <= 0))
+ ff_inlink_queued_frames(ctx->inputs[0]) <= 0 &&
+ ff_inlink_queued_frames(ctx->inputs[1]) <= 0)) {
ff_outlink_set_status(outlink, AVERROR_EOF, AV_NOPTS_VALUE);
+ } else if (s->xfade_is_over) {
+ ff_filter_set_ready(ctx, 100);
+ }
return 0;
}