diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-03-20 17:52:30 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-03-20 17:52:30 +0000 |
commit | d5a21172283572af587b3d939eba0091484d3263 (patch) | |
tree | 663c2dfe37bc66343717dd60f36d94fec2dd3efb /libavcodec/h263.c | |
parent | d66c7abc937069d57fb156bcecec16e406b88c7b (diff) | |
download | ffmpeg-d5a21172283572af587b3d939eba0091484d3263.tar.gz |
better non conformant divx packed bitstream detection, so unpacked (no b frames) divx MPEG4-ES streams can be read
Originally committed as revision 1695 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263.c')
-rw-r--r-- | libavcodec/h263.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c index b9b94efc9c..76a421a707 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -4566,6 +4566,7 @@ static int decode_user_data(MpegEncContext *s, GetBitContext *gb){ int i; int e; int ver, build, ver2, ver3; + char last; buf[0]= show_bits(gb, 8); for(i=1; i<256; i++){ @@ -4574,16 +4575,21 @@ static int decode_user_data(MpegEncContext *s, GetBitContext *gb){ skip_bits(gb, 8); } buf[255]=0; - + /* divx detection */ - e=sscanf(buf, "DivX%dBuild%d", &ver, &build); - if(e!=2) - e=sscanf(buf, "DivX%db%d", &ver, &build); - if(e==2){ + e=sscanf(buf, "DivX%dBuild%d%c", &ver, &build, &last); + if(e<2) + e=sscanf(buf, "DivX%db%d%c", &ver, &build, &last); + if(e>=2){ s->divx_version= ver; s->divx_build= build; + s->divx_packed= e==3 && last=='p'; if(s->picture_number==0){ - printf("This file was encoded with DivX%d Build%d\n", ver, build); + printf("This file was encoded with DivX%d Build%d", ver, build); + if(s->divx_packed) + printf("p\n"); + else + printf("\n"); } } |