[SDL] SDL_mixer is recognizing MP3 as MOD

Ryan C. Gordon icculus at icculus.org
Mon Jul 18 01:48:05 PDT 2011

> So I suppose there's no interest in including this in SDL_mixer?

I hadn't had a chance to look at it yet. I have now, though.

I think this patch should only check the magic if it needs to, instead 
of filling in the magic based on the requested type.

Right now, the patch is doing something like:

    if (want == MUS_OGG)
       strcpy(magic, "OggS");

    // later...

    if (strcmp(magic, "OggS") == 0)

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.


More information about the SDL mailing list