changeset 4470:2c9a66c5223a libavcodec

Set frame rate from extradata
author kostya
date Sun, 04 Feb 2007 10:45:01 +0000
parents a2e82396193c
children cfbd1f3d457c
files vc1.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/vc1.c	Sat Feb 03 13:15:55 2007 +0000
+++ b/vc1.c	Sun Feb 04 10:45:01 2007 +0000
@@ -1320,10 +1320,16 @@
 
         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;
+                }
             }
         }