1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

In yadif filter, default to top field first if interlacing is unknown

Originally committed as revision 26347 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Baptiste Coudurier 2011-01-15 00:32:36 +00:00
parent 3cdf69eefa
commit a51c71bb54
2 changed files with 10 additions and 1 deletions

View File

@ -996,6 +996,8 @@ enable automatic detection
@end table
Default value is -1.
If interlacing is unknown or decoder does not export this information,
top field first will be assumed.
@c man end VIDEO FILTERS

View File

@ -167,7 +167,14 @@ static void return_frame(AVFilterContext *ctx, int is_second)
{
YADIFContext *yadif = ctx->priv;
AVFilterLink *link= ctx->outputs[0];
int tff = yadif->parity == -1 ? yadif->cur->video->top_field_first : (yadif->parity^1);
int tff;
if (yadif->parity == -1) {
tff = yadif->cur->video->interlaced ?
yadif->cur->video->top_field_first : 1;
} else {
tff = yadif->parity^1;
}
if (is_second)
yadif->out = avfilter_get_video_buffer(link, AV_PERM_WRITE | AV_PERM_PRESERVE |