Commit 7d67e968 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

improving parsing of incomplete headers

Originally committed as revision 1585 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent e54d94ba
...@@ -4564,6 +4564,17 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){ ...@@ -4564,6 +4564,17 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
time_incr++; time_incr++;
check_marker(gb, "before time_increment"); 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); 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); //printf(" type:%d modulo_time_base:%d increment:%d\n", s->pict_type, time_incr, time_increment);
if(s->pict_type!=B_TYPE){ if(s->pict_type!=B_TYPE){
...@@ -4600,13 +4611,8 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){ ...@@ -4600,13 +4611,8 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
if(s->avctx->debug&FF_DEBUG_PTS) if(s->avctx->debug&FF_DEBUG_PTS)
printf("MPEG4 PTS: %f\n", s->current_picture.pts/(1000.0*1000.0)); 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){ check_marker(gb, "before vop_coded");
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);
}
/* vop coded */ /* vop coded */
if (get_bits1(gb) != 1){ if (get_bits1(gb) != 1){
printf("vop not coded\n"); printf("vop not coded\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment