only init music on use. workaround for audio bug.
authornemo
Wed, 13 May 2009 01:30:08 +0000
changeset 2050 8149802b4f14
parent 2049 243d363546e7
child 2051 949fe7df09b6
only init music on use. workaround for audio bug.
QTfrontend/SDLs.cpp
--- a/QTfrontend/SDLs.cpp	Tue May 12 15:17:49 2009 +0000
+++ b/QTfrontend/SDLs.cpp	Wed May 13 01:30:08 2009 +0000
@@ -26,10 +26,6 @@
 	music = NULL;
 
 	SDL_Init(SDL_INIT_VIDEO);
-	SDL_Init(SDL_INIT_AUDIO);
-	Mix_OpenAudio(22050, 0x8010, 2, 512);
-  
-	Mix_VolumeMusic(33);
 }
 
 SDLInteraction::~SDLInteraction()
@@ -60,7 +56,13 @@
 void SDLInteraction::StartMusic()
 {
 	if (!music)
+    {
+   	    SDL_Init(SDL_INIT_AUDIO);
+	    Mix_OpenAudio(22050, 0x8010, 2, 512);
+  
+	    Mix_VolumeMusic(33);
 		music = Mix_LoadMUS(QString(datadir->absolutePath() + "/Music/main theme.ogg").toLocal8Bit().constData());
+    }
 
 	Mix_FadeInMusic(music, -1, 3000);
 }