From 4b4282bc57b63de2780333d37487a38f88fb48c7 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sun, 27 Dec 2020 21:59:10 +0100 Subject: avfilter/vf_decimate: stop dropping last frames with ppsrc --- libavfilter/vf_decimate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_decimate.c b/libavfilter/vf_decimate.c index 93509d6ab3..32a4cdc535 100644 --- a/libavfilter/vf_decimate.c +++ b/libavfilter/vf_decimate.c @@ -267,7 +267,7 @@ static int activate(AVFilterContext *ctx) } if (ret < 0) { return ret; - } else if (dm->eof & ((1 << INPUT_MAIN) | (dm->ppsrc << INPUT_CLEANSRC))) { + } else if (dm->eof == ((1 << INPUT_MAIN) | ((dm->ppsrc << INPUT_CLEANSRC) * dm->ppsrc))) { ff_outlink_set_status(ctx->outputs[0], AVERROR_EOF, dm->last_pts); return 0; } else if (!(dm->eof & (1 << INPUT_MAIN)) && ff_inlink_acknowledge_status(ctx->inputs[INPUT_MAIN], &status, &pts)) { @@ -279,6 +279,7 @@ static int activate(AVFilterContext *ctx) } else if (dm->ppsrc && !(dm->eof & (1 << INPUT_CLEANSRC)) && ff_inlink_acknowledge_status(ctx->inputs[INPUT_CLEANSRC], &status, &pts)) { if (status == AVERROR_EOF) { // flushing dm->eof |= 1 << INPUT_CLEANSRC; + filter_frame(ctx->inputs[INPUT_MAIN], NULL); return filter_frame(ctx->inputs[INPUT_CLEANSRC], NULL); } } -- cgit v1.2.3