diff options
author | Simon Howard | 2009-11-21 16:36:46 +0000 |
---|---|---|
committer | Simon Howard | 2009-11-21 16:36:46 +0000 |
commit | afa0c4c7979c1508605d0e79487f299cd03adda6 (patch) | |
tree | 7df1745badf169e4490e3a56a89a28ac37977c14 /src/setup/sound.c | |
parent | 095bc1110b3c11fbf2e17bfd51bf78909fe34662 (diff) | |
parent | 2c6e7b2f10c32ca0406ca6753e7701d83e6dea8f (diff) | |
download | chocolate-doom-afa0c4c7979c1508605d0e79487f299cd03adda6.tar.gz chocolate-doom-afa0c4c7979c1508605d0e79487f299cd03adda6.tar.bz2 chocolate-doom-afa0c4c7979c1508605d0e79487f299cd03adda6.zip |
Merge from trunk.
Subversion-branch: /branches/raven-branch
Subversion-revision: 1737
Diffstat (limited to 'src/setup/sound.c')
-rw-r--r-- | src/setup/sound.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/setup/sound.c b/src/setup/sound.c index 0361ac62..97037ee9 100644 --- a/src/setup/sound.c +++ b/src/setup/sound.c @@ -23,6 +23,8 @@ #include <stdlib.h> +#include "SDL_mixer.h" + #include "textscreen.h" #include "m_config.h" @@ -60,19 +62,10 @@ static char *musicmode_strings[] = "CD audio" }; -// Disable MIDI music on OSX: there are problems with the native -// MIDI code in SDL_mixer. - -#ifdef __MACOSX__ -#define DEFAULT_MUSIC_DEVICE SNDDEVICE_NONE -#else -#define DEFAULT_MUSIC_DEVICE SNDDEVICE_SB -#endif - // Config file variables: int snd_sfxdevice = SNDDEVICE_SB; -int snd_musicdevice = DEFAULT_MUSIC_DEVICE; +int snd_musicdevice = SNDDEVICE_SB; int snd_samplerate = 22050; static int numChannels = 8; @@ -237,5 +230,21 @@ void BindSoundVariables(void) M_BindVariable("snd_sbirq", &snd_sbirq); M_BindVariable("snd_sbdma", &snd_sbdma); M_BindVariable("snd_mport", &snd_mport); + + // Before SDL_mixer version 1.2.11, MIDI music caused the game + // to crash when it looped. If this is an old SDL_mixer version, + // disable MIDI. + +#ifdef __MACOSX__ + { + const SDL_version *v = Mix_Linked_Version(); + + if (SDL_VERSIONNUM(v->major, v->minor, v->patch) + < SDL_VERSIONNUM(1, 2, 11)) + { + snd_musicdevice = SNDDEVICE_NONE; + } + } +#endif } |