diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-04-27 14:10:47 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-04-27 14:10:47 +0000 |
commit | f94985d046c5e0775e6bf259ec307398554341c6 (patch) | |
tree | 2bc4d7aad5c1139984a3aa80de3ce0ec8f574f9c /libavcodec/h263.c | |
parent | 2417652e9fbb2a4282909217fd53693bd7b7e11c (diff) | |
download | ffmpeg-f94985d046c5e0775e6bf259ec307398554341c6.tar.gz |
detecting xvid/divx4/opendivx and set low_delay flag
Originally committed as revision 425 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263.c')
-rw-r--r-- | libavcodec/h263.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c index 81c7fd7140..7543264210 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -2584,6 +2584,7 @@ int mpeg4_decode_picture_header(MpegEncContext * s) { int time_incr, startcode, state, v; int time_increment; + int vol_control=-1; redo: /* search next start code */ @@ -2627,7 +2628,7 @@ int mpeg4_decode_picture_header(MpegEncContext * s) skip_bits(&s->gb, 8); // par_height } - if(get_bits1(&s->gb)){ /* vol control parameter */ + if(vol_control=get_bits1(&s->gb)){ /* vol control parameter */ int chroma_format= get_bits(&s->gb, 2); if(chroma_format!=1){ printf("illegal chroma format\n"); @@ -2943,8 +2944,17 @@ int mpeg4_decode_picture_header(MpegEncContext * s) } } } + /* detect buggy encoders which dont set the low_delay flag (divx4/xvid/opendivx)*/ + // note we cannot detect divx5 without b-frames easyly (allthough its buggy too) + if(s->vo_type==0 && vol_control==0 && s->divx_version==0){ + if(s->picture_number==0) + printf("looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag\n"); + s->low_delay=1; + } + s->picture_number++; // better than pic number==0 allways ;) //printf("done\n"); + return 0; } |