[MPlayer-dev-eng] mp3 recognize bugfix for MPlayer-1.0pre7::libmpdemux/demux_audio.c

Stefan Bambach sbambach at gmx.net
Mon Sep 5 22:33:04 CEST 2005


Hi,

I run in trouble recognizing some mp3s... 

Old Algorithm:
check each byte position in stream und store possibly correct headers in
a list until 30000 bytes checked.
if 5 consecutive headers found, break and return mp3_found=true;


My Algorithm:
check each byte position in stream und store possibly correct headers in
a list until 30000 bytes checked. (same as old one)
return with mp3_found=true, if 5 correct headers were found in the
decoding means.


Example (framesize is 0x100 for better calculating :-))
-------
header at    framesize
0x000          0x100       OK
0x030          0x100
0x070          0x100
0x100          0x100       OK
0x110          0x100
0x130          0x100
0x180          0x100
0x200          0x100       OK
0x210          0x100
0x300          0x100       OK
0x400          0x100       OK

The old algorithm didn't recognize it as MP3 (didn't find 5 consecutive
headers; max was 2 (0x300 and 0x400)) !

Mine does
0x000+0x100+0x100+0x100+0x100 -> valid -> OK
0x030+0x100 -> too short
0x070 -> too short
0x110+0x100 -> too short
0x130 -> too short
0x180 -> too short
0x210 -> too short

So I check the headers like any mp3 decoder does:
next header = pos+framesize


PS:
mp3 header analysis code (mp3_hdr.c) is incomplete... I patched there
some things, but didn't need it any more. With above patch I got no more
problems.


ciao. Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-MPlayer-1.0pre7-add_mp3_hdrs.patch
Type: text/x-patch
Size: 1221 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20050905/8599d4d1/attachment.bin>


More information about the MPlayer-dev-eng mailing list