From 0d802ac54e86aee587f5e9917a2eefbfecd73571 Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Thu, 25 Aug 2011 12:36:13 -0700 Subject: 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 --- libavcodec/vc1dec.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libavcodec/vc1dec.c') diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 735d6c2e51..f4d6f997f8 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -3897,6 +3897,18 @@ static int vc1_decode_frame(AVCodecContext *avctx, goto err; } + // process pulldown flags + s->current_picture_ptr->f.repeat_pict = 0; + // Pulldown flags are only valid when 'broadcast' has been set. + // So ticks_per_frame will be 2 + if (v->rff){ + // repeat field + s->current_picture_ptr->f.repeat_pict = 1; + }else if (v->rptfrm){ + // repeat frames + s->current_picture_ptr->f.repeat_pict = v->rptfrm * 2; + } + // for skipping the frame s->current_picture.f.pict_type = s->pict_type; s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I; -- cgit v1.2.3