diff options
author | James Haley | 2010-01-26 00:59:02 +0000 |
---|---|---|
committer | James Haley | 2010-01-26 00:59:02 +0000 |
commit | b80409202d07732ec201c9816887262b505b81d4 (patch) | |
tree | 364dcb86f2c22411a720447bfa21c4de9191ff6f /src/setup/sound.c | |
parent | 66e8dc63bd0b384c99f0d0ff60b3d75c42d441b1 (diff) | |
parent | 8f6edc1f7402215c5e38d1f03939ce6b5ff5e3ae (diff) | |
download | chocolate-doom-b80409202d07732ec201c9816887262b505b81d4.tar.gz chocolate-doom-b80409202d07732ec201c9816887262b505b81d4.tar.bz2 chocolate-doom-b80409202d07732ec201c9816887262b505b81d4.zip |
Merge from raven-branch
Subversion-branch: /branches/strife-branch
Subversion-revision: 1825
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 } |