diff options
author | Paul B Mahol <onemda@gmail.com> | 2023-07-14 00:42:02 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2023-07-14 00:46:45 +0200 |
commit | 374184a4dc16421ec6b182191898582d9275808a (patch) | |
tree | 2c3db46774256a4676646294d81fccc74139822f | |
parent | 7bcc1b4eb8534fce66e53d0fc2d66a899bbad8a2 (diff) | |
download | ffmpeg-374184a4dc16421ec6b182191898582d9275808a.tar.gz |
avfilter/split: fix EOF passing to inlink
-rw-r--r-- | libavfilter/split.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libavfilter/split.c b/libavfilter/split.c index 98b51f976e..2a511668e2 100644 --- a/libavfilter/split.c +++ b/libavfilter/split.c @@ -67,11 +67,15 @@ static int activate(AVFilterContext *ctx) { AVFilterLink *inlink = ctx->inputs[0]; AVFrame *in; - int status, ret; + int status, ret, nb_eofs = 0; int64_t pts; - for (int i = 0; i < ctx->nb_outputs; i++) { - FF_FILTER_FORWARD_STATUS_BACK_ALL(ctx->outputs[i], ctx); + for (int i = 0; i < ctx->nb_outputs; i++) + nb_eofs += ff_outlink_get_status(ctx->outputs[i]) == AVERROR_EOF; + + if (nb_eofs == ctx->nb_outputs) { + ff_inlink_set_status(inlink, AVERROR_EOF); + return 0; } ret = ff_inlink_consume_frame(inlink, &in); |