Open bvssvni opened 9 years ago
I can confirm your problem and I have discovered why this happens! What usually should happen is if loops = 1
it should play the music 2 times (1 loop). The code we currently have works just fine. As it turns out, some bozo added this to the C SDL_mixer library in the Mix_FadeInMusicPos(...) (which is what Mix_PlayMusic(...) calls).
if (loops == 1) {
/* Loop is the number of times to play the audio */
loops = 0;
}
Long story short, this is an upstream bug, not ours.
https://bugzilla.libsdl.org/show_bug.cgi?id=2706
It seems they have it in their bug tracker already but nothing has really happened in it for some reason.
https://github.com/andelf/rust-sdl2_mixer/blob/324fdbb457556fbcd3417a7def9e5d20072beab0/src/sdl2_mixer/lib.rs#L641
For
loops
set to 0 and 1, it plays through once and stops, but for 2 it plays 3 times through.