summaryrefslogtreecommitdiff
path: root/libavcodec/vc1.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2007-02-04 10:45:01 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2007-02-04 10:45:01 +0000
commitf0c31621c6a77093659f8fe5cef67a732621ec77 (patch)
tree13bc7298ca3d56296245dad95521441de658a238 /libavcodec/vc1.c
parent5773d46009d63182217798f0d0dd31115f4a157e (diff)
Set frame rate from extradata
Originally committed as revision 7814 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vc1.c')
-rw-r--r--libavcodec/vc1.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index 2fb2ae2837..8c69808725 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -1320,10 +1320,16 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
if(get_bits1(gb)){ //framerate stuff
if(get_bits1(gb)) {
- get_bits(gb, 16);
+ v->s.avctx->time_base.num = 32;
+ v->s.avctx->time_base.den = get_bits(gb, 16) + 1;
} else {
- get_bits(gb, 8);
- get_bits(gb, 4);
+ int nr, dr;
+ nr = get_bits(gb, 8);
+ dr = get_bits(gb, 4);
+ if(nr && nr < 8 && dr && dr < 3){
+ v->s.avctx->time_base.num = fps_dr[dr - 1];
+ v->s.avctx->time_base.den = fps_nr[nr - 1] * 1000;
+ }
}
}