avfilter/vf_decimate: always properly handle EOF

pull/371/head
Paul B Mahol 4 years ago
parent 4b4282bc57
commit f1357274e9
  1. 13
      libavfilter/vf_decimate.c

@ -267,20 +267,25 @@ static int activate(AVFilterContext *ctx)
} }
if (ret < 0) { if (ret < 0) {
return ret; return ret;
} else if (dm->eof == ((1 << INPUT_MAIN) | ((dm->ppsrc << INPUT_CLEANSRC) * dm->ppsrc))) { } else if (dm->eof == ((1 << INPUT_MAIN) | (dm->ppsrc << INPUT_CLEANSRC))) {
ff_outlink_set_status(ctx->outputs[0], AVERROR_EOF, dm->last_pts); ff_outlink_set_status(ctx->outputs[0], AVERROR_EOF, dm->last_pts);
return 0; return 0;
} else if (!(dm->eof & (1 << INPUT_MAIN)) && ff_inlink_acknowledge_status(ctx->inputs[INPUT_MAIN], &status, &pts)) { } else if (!(dm->eof & (1 << INPUT_MAIN)) && ff_inlink_acknowledge_status(ctx->inputs[INPUT_MAIN], &status, &pts)) {
if (status == AVERROR_EOF) { // flushing if (status == AVERROR_EOF) { // flushing
dm->eof |= 1 << INPUT_MAIN; dm->eof |= 1 << INPUT_MAIN;
if (!dm->ppsrc) if (dm->ppsrc)
return filter_frame(ctx->inputs[INPUT_MAIN], NULL); filter_frame(ctx->inputs[INPUT_CLEANSRC], NULL);
filter_frame(ctx->inputs[INPUT_MAIN], NULL);
ff_outlink_set_status(ctx->outputs[0], AVERROR_EOF, dm->last_pts);
return 0;
} }
} else if (dm->ppsrc && !(dm->eof & (1 << INPUT_CLEANSRC)) && ff_inlink_acknowledge_status(ctx->inputs[INPUT_CLEANSRC], &status, &pts)) { } else if (dm->ppsrc && !(dm->eof & (1 << INPUT_CLEANSRC)) && ff_inlink_acknowledge_status(ctx->inputs[INPUT_CLEANSRC], &status, &pts)) {
if (status == AVERROR_EOF) { // flushing if (status == AVERROR_EOF) { // flushing
dm->eof |= 1 << INPUT_CLEANSRC; dm->eof |= 1 << INPUT_CLEANSRC;
filter_frame(ctx->inputs[INPUT_MAIN], NULL); filter_frame(ctx->inputs[INPUT_MAIN], NULL);
return filter_frame(ctx->inputs[INPUT_CLEANSRC], NULL); filter_frame(ctx->inputs[INPUT_CLEANSRC], NULL);
ff_outlink_set_status(ctx->outputs[0], AVERROR_EOF, dm->last_pts);
return 0;
} }
} }

Loading…
Cancel
Save