oops, that's wrong; revert until I get it right

This commit is contained in:
Glenn Maynard
2004-08-30 07:27:34 +00:00
parent 7756e03067
commit 07657c6203
+7 -14
View File
@@ -93,12 +93,9 @@ CHECKPOINT;
CHECKPOINT; CHECKPOINT;
if( ToPlay.file.empty() ) if( ToPlay.file.empty() )
{ {
/* StopPlaying() can take a while, so don't hold the lock while we stop. */ if( g_Playing->m_Music->IsPlaying() )
MusicPlaying *pOldPlaying = g_Playing; g_Playing->m_Music->StopPlaying();
g_Playing = new MusicPlaying( new RageSound ); g_Playing->m_Music->Unload();
L.Unlock();
delete pOldPlaying;
return; return;
} }
CHECKPOINT; CHECKPOINT;
@@ -108,7 +105,6 @@ CHECKPOINT;
CHECKPOINT; CHECKPOINT;
/* See if we can find timing data, if it's not already loaded. */ /* See if we can find timing data, if it's not already loaded. */
/* XXX: don't IsAFile while holding g_Mutex */
if( !ToPlay.HasTiming && IsAFile(ToPlay.timing_file) ) if( !ToPlay.HasTiming && IsAFile(ToPlay.timing_file) )
{ {
LOG->Trace("Found '%s'", ToPlay.timing_file.c_str()); LOG->Trace("Found '%s'", ToPlay.timing_file.c_str());
@@ -286,13 +282,10 @@ static void StartQueuedSounds()
else else
{ {
CHECKPOINT; CHECKPOINT;
/* StopPlaying() can take a while, so don't hold the lock while we stop. */ LockMutex L( *g_Mutex );
g_Mutex->Lock(); if( g_Playing->m_Music->IsPlaying() )
MusicPlaying *pOldPlaying = g_Playing; g_Playing->m_Music->StopPlaying();
g_Playing = new MusicPlaying( new RageSound ); g_Playing->m_Music->Unload();
g_Mutex->Unlock();
delete pOldPlaying;
} }
delete pMusic; delete pMusic;
} }