aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-02-14 01:47:10 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-02-14 01:47:10 +0000
commit7d67e968a4ec375257c21e4658d91452aeba9a74 (patch)
tree36ef06ec4d4c806a0b92f8a27e9de139fbb6b41e
parente54d94ba4e17a7cbb830e7cd6d845d326764e0f7 (diff)
downloadffmpeg-7d67e968a4ec375257c21e4658d91452aeba9a74.tar.gz
improving parsing of incomplete headers
Originally committed as revision 1585 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/h263.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c
index e9c80bfb39..c456574e28 100644
--- a/libavcodec/h263.c
+++ b/libavcodec/h263.c
@@ -4564,6 +4564,17 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
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 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
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");