SDL-mixer and SDL-sound: Problem with mp3 support

Manuel A. Fernandez Montecelo manuel.montezelo at gmail.com
Sat Dec 21 19:03:29 UTC 2013


Control: tag 708297 + upstream

2013/5/15 Vincent Prat <vinceprat at free.fr>:
>
>> I don't really know what's happening, just suggestions below.
>>
>> Were you using the same Debian architecture in the past, or did you
>> switch from i386->amd64 between working and failing?
>
> The only change between working and failing is the upgrade from squeeze to
> wheezy.
>
>
>>
>> And by the way, did you also try other format types (ogg, flac, wav)
>> and observe any anomaly?
>
> I have tried all these formats without any problem.

After compiling the binaries (had to use -fpermissive [1]), this is what I get:

------------------
$ ./playsound_simple ../scream.mp3
Now playing [../scream.mp3]...
Error decoding file: (null)

$ ./playsound ../scream.mp3
Now playing [../scream.mp3]...
Error in decoding sound file!
  reason: [MPGLIB: Free format not supported.].
------------------

So it seems that the .mp3 that you are playing is not supported by the
library.  From this reply of the author in the support mailing list
(from 2007, but the code does not seem to have changed much since
then, and indeed the code seems very fragile):

------------------
http://icculus.org/pipermail/sdlsound/2007-January/000655.html

mpglib is deeply unforgiving about file corruption...it gives up
immediately when it sees data it doesn't expect, which is a problem with
a lot of mp3s out there.

Also, unfortunately, one of the things it doesn't expect is ID3v2 tags,
so that excludes the vast majority of mp3s created in the past few
years. This is fairly easy to fix, just no one ever has (for ID3v1, we
just look for the struct in the last 128 bytes of the mp3, and don't
pass it to mpglib if we see it. ID3v2's layout is somewhat more
complicated, but something similar can still be done). In a more ideal
world, someone would take the time to understand the mpglib code and
make it recover from bad data. Or replace it with a different mp3
decoder, but I haven't found one that isn't GPL'd.

SDL_sound's SMPEG backend is more forgiving of strange data, but has its
own problems too. Use Ogg files if you control your content.  :)

As you can tell by my long apology here, we're sort of at the mercy of a
  disproportionate amount of third-party code here.
------------------


Cheers.
-- 
Manuel A. Fernandez Montecelo <manuel.montezelo at gmail.com>


[1]

g++ -fpermissive -I/usr/include/SDL -lSDL -lSDL_sound
playsound_simple.c -o playsound_simple

g++ -fpermissive -I/usr/include/SDL -lSDL -lSDL_sound -DHAVE_SIGNAL_H
playsound.c -o playsound



More information about the Pkg-sdl-maintainers mailing list