changeset 1068:a5be963709d1 libavcodec

improving parsing of incomplete headers
author michaelni
date Fri, 14 Feb 2003 01:47:10 +0000
parents 54aa0bb40e97
children 8528d0b9e508
files h263.c
diffstat 1 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/h263.c	Tue Feb 11 21:13:30 2003 +0000
+++ b/h263.c	Fri Feb 14 01:47:10 2003 +0000
@@ -4564,6 +4564,17 @@
         time_incr++;
 
     check_marker(gb, "before time_increment");
+    
+    if(s->picture_number==0 && (show_bits(gb, s->time_increment_bits+1)&1)==0){
+        printf("hmm, seems the headers arnt complete, trying to guess time_increment_bits\n");
+        
+
+        for(s->time_increment_bits=1 ;s->time_increment_bits<16; s->time_increment_bits++){
+            if(show_bits(gb, s->time_increment_bits+1)&1) break;
+        }
+        printf("my guess is %d bits ;)\n",s->time_increment_bits);
+    }
+    
     time_increment= get_bits(gb, s->time_increment_bits);
 //printf(" type:%d modulo_time_base:%d increment:%d\n", s->pict_type, time_incr, time_increment);
     if(s->pict_type!=B_TYPE){
@@ -4600,13 +4611,8 @@
     if(s->avctx->debug&FF_DEBUG_PTS)
         printf("MPEG4 PTS: %f\n", s->current_picture.pts/(1000.0*1000.0));
     
-    if(check_marker(gb, "before vop_coded")==0 && s->picture_number==0){
-        printf("hmm, seems the headers arnt complete, trying to guess time_increment_bits\n");
-        for(s->time_increment_bits++ ;s->time_increment_bits<16; s->time_increment_bits++){
-            if(get_bits1(gb)) break;
-        }
-        printf("my guess is %d bits ;)\n",s->time_increment_bits);
-    }
+    check_marker(gb, "before vop_coded");
+    
     /* vop coded */
     if (get_bits1(gb) != 1){
         printf("vop not coded\n");