[SDL] SDL_mixer is recognizing MP3 as MOD
realnc at arcor.de
Mon Jul 18 04:23:56 PDT 2011
On 07/18/2011 11:48 AM, Ryan C. Gordon wrote:
>> So I suppose there's no interest in including this in SDL_mixer?
> I think this patch should only check the magic if it needs to, instead
> of filling in the magic based on the requested type.
> The patch is better done like this...
> if (want == MUS_NONE)
> // only do i/o and string manipulation if we have to...
> if (strcmp(magic, "OggS") == 0)
> want = MUS_OGG;
> // later...
> if (want == MUS_OGG)
> Otherwise, I think the concept is good. If you clean that up, I'll
> commit the patch.
I went for something minimal. For doing it "the right way", the patch
is a bit longer:
The auto-detection is now performed by detect_music_type() (static
helper). This is intended to also be used by Mix_LoadMUS() in order to
avoid the current code duplication. I didn't change Mix_LoadMUS()
though; if this patch is good enough to be committed, I will follow with
another that will deal with Mix_LoadMUS().
I am attaching the new patch. I'm not sure if the coding style follows
your preferences, since it seems SDL_mixer's code does not follow a
single style throughout, but deviates a bit (mostly spacing) so I was
not sure which one to use.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 9033 bytes
Desc: not available
More information about the SDL