mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-24 02:20:56 +01:00
avfilter/vf_decimate: always properly handle EOF
This commit is contained in:
parent
4b4282bc57
commit
f1357274e9
1 changed files with 9 additions and 4 deletions
|
|
@ -267,20 +267,25 @@ static int activate(AVFilterContext *ctx)
|
|||
}
|
||||
if (ret < 0) {
|
||||
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);
|
||||
return 0;
|
||||
} else if (!(dm->eof & (1 << INPUT_MAIN)) && ff_inlink_acknowledge_status(ctx->inputs[INPUT_MAIN], &status, &pts)) {
|
||||
if (status == AVERROR_EOF) { // flushing
|
||||
dm->eof |= 1 << INPUT_MAIN;
|
||||
if (!dm->ppsrc)
|
||||
return filter_frame(ctx->inputs[INPUT_MAIN], NULL);
|
||||
if (dm->ppsrc)
|
||||
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)) {
|
||||
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);
|
||||
filter_frame(ctx->inputs[INPUT_CLEANSRC], NULL);
|
||||
ff_outlink_set_status(ctx->outputs[0], AVERROR_EOF, dm->last_pts);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue