diff options
author | John Stebbins <stebbins@jetheaddev.com> | 2011-08-25 12:36:13 -0700 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-08-25 12:41:45 -0700 |
commit | 0d802ac54e86aee587f5e9917a2eefbfecd73571 (patch) | |
tree | 0701e22e6a3ddf139652615995f2a6a9e7b8335c /libavcodec/vc1.c | |
parent | 1cf82cab0840d669198ea76ab0363aa661950647 (diff) | |
download | ffmpeg-0d802ac54e86aee587f5e9917a2eefbfecd73571.tar.gz |
vc1: fix VC-1 Pulldown handling.
Pulldown flags are being set incorrectly and AVFrame->repeat_pict is not
being set. Also, skipped frames exit header parsing too early and do not
set pulldown flags appropriately. Ticks_per_frame needs to be set and
time_base adjusted so player can extend frame duration by a field time.
This fixes problems encountered when attempting to transcode HD-DVD EVOB
files with HandBrake. Also makes these files play smoothly in avplay.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavcodec/vc1.c')
-rw-r--r-- | libavcodec/vc1.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index fe9781b5de..c3649ac383 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -501,6 +501,10 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb) v->s.avctx->time_base.den = ff_vc1_fps_nr[nr - 1] * 1000; } } + if(v->broadcast) { // Pulldown may be present + v->s.avctx->time_base.den *= 2; + v->s.avctx->ticks_per_frame = 2; + } } if(get_bits1(gb)){ @@ -818,7 +822,7 @@ int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) case 4: v->s.pict_type = AV_PICTURE_TYPE_P; // skipped pic v->p_frame_skipped = 1; - return 0; + break; } if(v->tfcntrflag) skip_bits(gb, 8); @@ -827,13 +831,16 @@ int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) v->rptfrm = get_bits(gb, 2); } else { v->tff = get_bits1(gb); - v->rptfrm = get_bits1(gb); + v->rff = get_bits1(gb); } } if(v->panscanflag) { av_log_missing_feature(v->s.avctx, "Pan-scan", 0); //... } + if(v->p_frame_skipped) { + return 0; + } v->rnd = get_bits1(gb); if(v->interlace) v->uvsamp = get_bits1(gb); |