[SDL] SDL_mixer is recognizing MP3 as MOD

Nikos Chantziaras realnc at arcor.de
Sat Jul 16 00:50:01 PDT 2011

On 07/16/2011 08:46 AM, Nikos Chantziaras wrote:
> On 07/16/2011 08:17 AM, Mason Wheeler wrote:
>> You need some way for it to recognize what you have as an MP3.
>> What would you propose?
> An argument to Mix_LoadMUS_RW() for the type. But this breaks the API,
> of course. So if there's not going to be an SDL_mixer 2.0 any time soon,
> a new Mix_LoadMUS_Type_RW() might do it.

I now introduced a new function:

   Mix_Music * Mix_LoadMUSType_RW(SDL_RWops *rw, Mix_MusicType type)

'type' can be NULL, which means auto-detection will be performed.  The 
normal Mix_LoadMUS_RW() routine now has only a single line:

   Mix_Music *Mix_LoadMUS_RW(SDL_RWops *rw)
       return Mix_LoadMUSType_RW(rw, MUS_NONE);

Note that Mix_LoadMUS_RW() can't be defined as a macro, since that 
breaks binary compatibility.

I am attaching the patch against current Hg.  It's quite short, but 
please take a look at it in case I screwed something up.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mustype_support.patch
Type: text/x-patch
Size: 3716 bytes
Desc: not available
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110716/67bf1f89/attachment-0008.bin>

More information about the SDL mailing list