avfilter/vf_nnedi: set frame_rate only when needed

This commit is contained in:
Paul B Mahol 2022-04-30 10:01:23 +02:00
parent 55e0b041b3
commit 6018fa899f
1 changed files with 4 additions and 2 deletions

View File

@ -166,13 +166,15 @@ AVFILTER_DEFINE_CLASS(nnedi);
static int config_output(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
const NNEDIContext *const s = ctx->priv;
outlink->time_base = av_mul_q(ctx->inputs[0]->time_base, (AVRational){1, 2});
outlink->w = ctx->inputs[0]->w;
outlink->h = ctx->inputs[0]->h;
outlink->frame_rate = av_mul_q(ctx->inputs[0]->frame_rate,
(AVRational){2, 1});
if (s->field == -2 || s->field > 1)
outlink->frame_rate = av_mul_q(ctx->inputs[0]->frame_rate,
(AVRational){2, 1});
return 0;
}