From 2bb337d8c3428b8497778ad43d3275f237957704 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 16 Dec 2002 02:09:31 +0000 Subject: [PATCH] fix a race condition remove an unused variable --- stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp b/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp index ef65b3d9b9..c2d76098dc 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp @@ -42,6 +42,10 @@ void RageSound_DSound::MixerThread() while(!shutdown) { Sleep(10); + /* SOUNDMAN will be set once RageSoundManager's ctor returns and + * assigns it; we might get here before that happens, though. */ + if(!SOUNDMAN) continue; + LockMutex L(SOUNDMAN->lock); for(unsigned i = 0; i < stream_pool.size(); ++i) { @@ -93,7 +97,6 @@ void RageSound_DSound::stream::GetPCM(bool init) last_cursor_pos = 0; } else { result = str_ds->GetCurrentPosition(&cursor, &junk); - int playcursor = cursor; if ( result == DSERR_BUFFERLOST ) { str_ds->Restore(); result = str_ds->GetCurrentPosition(&cursor, &junk);