avfilter/split: fix EOF passing to inlink

This commit is contained in:
Paul B Mahol 2023-07-14 00:42:02 +02:00
parent 7bcc1b4eb8
commit 374184a4dc
1 changed files with 7 additions and 3 deletions

View File

@ -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);