about summary refs log tree commit diff
path: root/src/engine/client/sound.cpp
diff options
context:
space:
mode:
authoroy <tom_adams@web.de>2012-01-03 15:40:30 -0800
committeroy <tom_adams@web.de>2012-01-03 15:40:30 -0800
commit7328098f8d03e65975ec82162d2049f46fed223d (patch)
tree1c42d719df3971a3a8558a6a1a30c68b4b6f574e /src/engine/client/sound.cpp
parentc975390195eed17c615bbebfab981a2394dec424 (diff)
parent7393151b6d4cbfd8c4be29145344dcce22aa47d7 (diff)
downloadzcatch-7328098f8d03e65975ec82162d2049f46fed223d.tar.gz
zcatch-7328098f8d03e65975ec82162d2049f46fed223d.zip
Merge pull request #912 from matricks/threadedflip
Threadedflip
Diffstat (limited to 'src/engine/client/sound.cpp')
-rw-r--r--src/engine/client/sound.cpp7
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;
 }