Mercurial > libavcodec.hg
diff h263.c @ 1145:79e8ed620b17 libavcodec
better non conformant divx packed bitstream detection, so unpacked (no b frames) divx MPEG4-ES streams can be read
| author | michaelni |
|---|---|
| date | Thu, 20 Mar 2003 17:52:30 +0000 |
| parents | 21c85c4ab2f0 |
| children | dde68a430ba9 |
line wrap: on
line diff
--- a/h263.c Thu Mar 20 01:00:57 2003 +0000 +++ b/h263.c Thu Mar 20 17:52:30 2003 +0000 @@ -4566,6 +4566,7 @@ 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 @@ 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"); } }
