I have found a bug in the SDL_mixer, using Mix_FadeOutMusic().
I use in Daimonin small ambient infinitive loop sounds for different
maps - if you change a map, the new ambient sound is loaded and the
old one fades out.
Used with Mix_HookMusicFinished() and the callback function, all works
fine - the callback init after the fadeout the new music.
The bug happens when you have small music files (i use ogg files) and a
large fade out value - i use 4000 ms for a smooth fade.
If the sound file is finished playing (and then looped again from the
sdl_mixer engine) BEFORE the 4000ms from the fade command are done, the
sound file is looped and played and the Mix_FadeOutMusic() will fail.
Means, the callback command will never be called.
This is really bad, because the Mix_FadeOutMusic() means “fade out and end”.
I assume that the callback is called when fadeout is done OR the file has
ended.
This is a really important point, because you will need ALOT of control and
extra
code when fadeout can fail without warnings.
I compiled the cvs version too, the bug is still in.
Compiling the cvs, i noticed that the VisualC files are outdated.
In SDL_mixer project part the files load_ogg.c and load_ogg.h are not
included
and the link will break with a unresolved symbol error.
Also, i got 2 warnings in load.ogg.c about implicit conversion from _int64
to
int in line 46 and 108 - it seems these are file length values, so perhaps
with
REALLY long files the player will break - i gave it only a quick look, so
perhaps its uncritical.
BTW, i had changed from smpeg to sdl_mixer/ogg for my background music.
Having
native support of a heavy compression file format in the mixer is a major
step
for SDL and i am very impressed about the easy interface.
SMPEG is now more as 15 month not updated, the last release 0.4.4 is broken
(loop don’t work, you need to use 0.4.3 when you want loop a mp3) and the
interface is ugly and imcomplete.
Perhaps it is time to include a native mp3 play in the mixer too?