avcodec/vc1: fix time_base and framerate
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 15 Oct 2014 13:54:02 +0000 (15:54 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 15 Oct 2014 14:08:36 +0000 (16:08 +0200)
They are not just inverses of each other.
This should restore behavior to before the introduction of framerate

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/vc1.c
libavcodec/vc1_parser.c

index b03eb94..b3955f2 100644 (file)
@@ -490,7 +490,6 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
                 }
             }
             if (v->broadcast) { // Pulldown may be present
-                v->s.avctx->framerate.num  *= 2;
                 v->s.avctx->ticks_per_frame = 2;
             }
         }
index 33e672f..3a2308e 100644 (file)
@@ -112,6 +112,8 @@ static void vc1_extract_header(AVCodecParserContext *s, AVCodecContext *avctx,
 
         break;
     }
+    if (avctx->framerate.num)
+        avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1}));
 }
 
 static int vc1_parse(AVCodecParserContext *s,