diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2012-01-03 21:39:10 +0100 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2012-01-03 21:39:10 +0100 |
| commit | 50d872531aae6640f57da98e8dcf6dbae1f9cd82 (patch) | |
| tree | e3a88d02f1b7ec3a37a4e3b6acb2413e51cbebc2 /src/engine/client/sound.cpp | |
| parent | e59b24d8db8a7a9ec21c654302d89e01903f4d96 (diff) | |
| download | zcatch-50d872531aae6640f57da98e8dcf6dbae1f9cd82.tar.gz zcatch-50d872531aae6640f57da98e8dcf6dbae1f9cd82.zip | |
cleaned up the code. fixed so that SDL is inited on main thread and then transfers the gl context to the render thread
Diffstat (limited to 'src/engine/client/sound.cpp')
| -rw-r--r-- | src/engine/client/sound.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/engine/client/sound.cpp b/src/engine/client/sound.cpp index 45404d18..3f3d1a5d 100644 --- a/src/engine/client/sound.cpp +++ b/src/engine/client/sound.cpp @@ -209,6 +209,12 @@ int CSound::Init() if(!g_Config.m_SndEnable) return 0; + if(SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) + { + dbg_msg("gfx", "unable to init SDL audio: %s", SDL_GetError()); + return -1; + } + m_MixingRate = g_Config.m_SndRate; // Set 16-bit stereo audio at 22Khz @@ -256,6 +262,7 @@ int CSound::Update() int CSound::Shutdown() { SDL_CloseAudio(); + SDL_QuitSubSystem(SDL_INIT_AUDIO); lock_destroy(m_SoundLock); return 0; } |