diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2010-11-22 20:42:08 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2010-11-22 20:42:08 +0000 |
commit | 902d49eef75d422344c0dad1b31c01a3b21380af (patch) | |
tree | 23f0d677e08d1767afc994cf706feaae298f4371 /libavfilter/vf_yadif.c | |
parent | 6b133d7e9c767c7d0bc39f2b301afd17c491c178 (diff) | |
download | ffmpeg-902d49eef75d422344c0dad1b31c01a3b21380af.tar.gz |
In yadif filter, copy video props to output picture.
Fix issue #2269.
Interpolate pts for the second frame when using field output mode.
Originally committed as revision 25798 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter/vf_yadif.c')
-rw-r--r-- | libavfilter/vf_yadif.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c index 9e700f9d5b..5c4a2455d3 100644 --- a/libavfilter/vf_yadif.c +++ b/libavfilter/vf_yadif.c @@ -175,8 +175,17 @@ static void return_frame(AVFilterContext *ctx, int is_second) filter(ctx, yadif->out, tff ^ !is_second, tff); - if (is_second) + if (is_second) { + if (yadif->next->pts != AV_NOPTS_VALUE && + yadif->cur->pts != AV_NOPTS_VALUE) { + yadif->out->pts = + (yadif->next->pts&yadif->cur->pts) + + ((yadif->next->pts^yadif->cur->pts)>>1); + } else { + yadif->out->pts = AV_NOPTS_VALUE; + } avfilter_start_frame(ctx->outputs[0], yadif->out); + } avfilter_draw_slice(ctx->outputs[0], 0, link->h, 1); avfilter_end_frame(ctx->outputs[0]); @@ -206,7 +215,8 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) yadif->out = avfilter_get_video_buffer(ctx->outputs[0], AV_PERM_WRITE | AV_PERM_PRESERVE | AV_PERM_REUSE, link->w, link->h); - yadif->out->pts = yadif->cur->pts; + avfilter_copy_buffer_ref_props(yadif->out, yadif->cur); + yadif->out->video->interlaced = 0; avfilter_start_frame(ctx->outputs[0], yadif->out); } |