History

avfilter/vf_nnedi: set frame_rate only when needed

Paul B Mahol committed 4 years ago

Commit 6018fa81 parent 55e0b041 file · +4 −2Browse files

Unified · Split

libavfilter/vf_nnedi.c+4−2
@@ -166,13 +166,15 @@ AVFILTER_DEFINE_CLASS(nnedi); · 165 unmodified lines
166166 static int config_output(AVFilterLink *outlink)
167167 {
168168 AVFilterContext *ctx = outlink->src;
169+ const NNEDIContext *const s = ctx->priv;
169170
170171 outlink->time_base = av_mul_q(ctx->inputs[0]->time_base, (AVRational){1, 2});
171172 outlink->w = ctx->inputs[0]->w;
172173 outlink->h = ctx->inputs[0]->h;
173174
174− outlink->frame_rate = av_mul_q(ctx->inputs[0]->frame_rate,
175− (AVRational){2, 1});
175+ if (s->field == -2 || s->field > 1)
176+ outlink->frame_rate = av_mul_q(ctx->inputs[0]->frame_rate,
177+ (AVRational){2, 1});
176178
177179 return 0;
178180 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t