Skip to content

Commit

Permalink
Date: Fri, 22 Apr 2005 21:07:49 -0600
Browse files Browse the repository at this point in the history
From: Tyler Montbriand
Subject: [SDL] SDL_mixer mikmod patch

When SDL_mixer calls MikMod_RegisterAllDrivers using it's internally
compiled-in audio drivers, the only driver it registers is the nosound audio
driver.  When it's using an external mikmod library, it initializes any and
all drivers it has available, such as OSS, ESD, and so forth.  Because of the
way SDL_mixer uses mikmod directly, this will often work, but will do silly
things like open the audio device twice -- once by SDL, once by MikMod.
Worst case it will hang hard as MikMod attempts to open a busy audio device.

All it needs is the nosound driver for it to work, not ALL mikmod drivers.
The attached patch causes it to only initialize that one when using an
external mikmod library.
  • Loading branch information
slouken committed May 16, 2005
1 parent 960ca1c commit 9da35fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion music.c
Expand Up @@ -389,8 +389,11 @@ int open_music(SDL_AudioSpec *mixer)
#endif
#ifdef LIBMIKMOD_MUSIC
if(!MikMod_InfoDriver())
#endif
MikMod_RegisterDriver(&drv_nos);
#else
MikMod_RegisterAllDrivers();
#endif

#ifdef LIBMIKMOD_MUSIC
if(!MikMod_InfoLoader())
#endif
Expand Down

0 comments on commit 9da35fb

Please sign in to comment.