SDL_Mixer: "Divide by zero" error after u pdating to 1.2.10

I just updated my sdl_mixer.dll to version 1.2.10. But now I get a runtime error
200 whenever I try to play an ogg or midi file with it:

PROCEDURE LoadAndPlayMusic(Const MusicFile : PChar);
BEGIN
IF Mix_PlayingMusic() <> 0 THEN Mix_HaltMusic();
IF MusicNumber <> NIL THEN BEGIN
Mix_FreeMusic(MusicNumber);
MusicNumber := NIL;
END;
MusicNumber := Mix_LoadMUS(MusicFile);
IF MusicNumber <> NIL THEN Mix_PlayMusic(MusicNumber, 1); <-- Runtime
error 200 on this line
END;

That’s Pascal code. I’m using the JEDI-SDL Pascal headers. Never had any
problems with the previous versions. Any ideas what’s going on?

I assume you have the mikmod and vorbis shared libraries somewhere
where SDL_mixer can find them?

Do you get the same problems with playmus included with SDL_mixer? If
so, can you post a link to music that shows this problem?

Thanks!On Wed, Nov 11, 2009 at 2:09 PM, Christian Knudsen wrote:

I just updated my sdl_mixer.dll to version 1.2.10. But now I get a runtime error
200 whenever I try to play an ogg or midi file with it:

PROCEDURE LoadAndPlayMusic(Const MusicFile : PChar);
BEGIN
? IF Mix_PlayingMusic() <> 0 THEN Mix_HaltMusic();
? IF MusicNumber <> NIL THEN BEGIN
? ? ?Mix_FreeMusic(MusicNumber);
? ? ?MusicNumber := NIL;
? END;
? MusicNumber := Mix_LoadMUS(MusicFile);
? IF MusicNumber <> NIL THEN Mix_PlayMusic(MusicNumber, 1); ? ?<-- Runtime
error 200 on this line
END;

That’s Pascal code. I’m using the JEDI-SDL Pascal headers. Never had any
problems with the previous versions. Any ideas what’s going on?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

Argh, I didn’t have mikmod. I didn’t need that before, though?

But now I have another problem. I can only play a music file once. If I set it
playing, then set it playing again, there’s silence. I can get it to loop
continuously with Mix_PlayMusic(MusicNumber, -1), but if I do
Mix_PlayMusic(MusicNumber, 0) or Mix_PlayMusic(MusicNumber, 1) it will only play
it once even though I call it again. I didn’t have any problem with this before.

Also, the documentation says that if you set the play times to zero, it will
play zero times. It doesn’t; it plays it one time.

The latest pre-release snapshot fixes the issue where you need mikmod
to play any music:
http://www.libsdl.org/tmp/SDL_mixer/On Thu, Nov 12, 2009 at 3:17 AM, Christian Knudsen wrote:

Argh, I didn’t have mikmod. I didn’t need that before, though?

But now I have another problem. I can only play a music file once. If I set it
playing, then set it playing again, there’s silence. I can get it to loop
continuously with Mix_PlayMusic(MusicNumber, -1), but if I do
Mix_PlayMusic(MusicNumber, 0) or Mix_PlayMusic(MusicNumber, 1) it will only play
it once even though I call it again. I didn’t have any problem with this before.

Also, the documentation says that if you set the play times to zero, it will
play zero times. It doesn’t; it plays it one time.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

Yes, only being able to play a file once is a bug that’s fixed in the
pre-release:
http://www.libsdl.org/tmp/SDL_mixer/

Which documentation is incorrect?
The header file states:
If ‘loops’ is greater than zero, loop the sound that many times.On Thu, Nov 12, 2009 at 3:17 AM, Christian Knudsen wrote:

Argh, I didn’t have mikmod. I didn’t need that before, though?

But now I have another problem. I can only play a music file once. If I set it
playing, then set it playing again, there’s silence. I can get it to loop
continuously with Mix_PlayMusic(MusicNumber, -1), but if I do
Mix_PlayMusic(MusicNumber, 0) or Mix_PlayMusic(MusicNumber, 1) it will only play
it once even though I call it again. I didn’t have any problem with this before.

Also, the documentation says that if you set the play times to zero, it will
play zero times. It doesn’t; it plays it one time.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

Sam Lantinga <slouken libsdl.org> writes:

Yes, only being able to play a file once is a bug that’s fixed in the
pre-release:
http://www.libsdl.org/tmp/SDL_mixer/

Which documentation is incorrect?
The header file states:
If ‘loops’ is greater than zero, loop the sound that many times.

Mix_PlayMusic(0) plays the song once. Mix_PlayMusic(1) also plays the song once,
but I understand that looping the sound 1 time means playing it once and then
playing it again, i.e. repeating. But maybe I shouldn’t read “loop” as repeat?