[SDL] SDL_mixer is recognizing MP3 as MOD

Ryan C. Gordon icculus at icculus.org
Fri Jul 15 17:23:26 PDT 2011


>     http://foss.aegean.gr/~realnc/file.mp3
>
>   From what I can tell at looking in the file, it was encoded with LAME.

It is, strictly speaking, a corrupt MP3. It's got a bunch of NULL bytes 
at the front.

That being said, there are a lot of corrupt MP3 files that will play 
without obvious problems if you let the player skip ahead until it finds 
valid frames, so here's a patch for Mix_LoadMUS() that will ignore the 
magic in mp3 files. Please note that this won't work for 
Mix_LoadMUS_RW(), as that doesn't take a filename. Basically this patch 
says: if you say it's an ".mp3", we'll believe you.

I don't have SMPEG or libmad installed here, so you'll have to tell me 
if this works for you before I can commit it. Attached.

--ryan.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sdlmixer-no-mp3-magic-RYAN1.diff
Type: text/x-diff
Size: 1476 bytes
Desc: not available
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110715/09a0e1d3/attachment-0008.diff>


More information about the SDL mailing list