SPU2ghz: Removing the Sleep() caused XP's XAudio2 to crash again. But I found a note from Microsoft on one of their dev journals that said to put the Sleep() immediately after the FlushBuffers and before the DestroyVoice. Let's cross some fingers and hope it works! (don't you love beta libs from microsoft?)

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@303 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
Jake.Stine 2008-11-05 14:49:18 +00:00 committed by Gregory Hainaut
parent 74365aa6bf
commit 3968775bc6
1 changed files with 5 additions and 6 deletions

View File

@ -176,17 +176,16 @@ public:
//
if( pSourceVoice != NULL )
{
pSourceVoice->Stop( 0 );
pSourceVoice->FlushSourceBuffers();
//pSourceVoice->Stop( 0 );
Sleep(10); // give the engine some time to flush voices
pSourceVoice->DestroyVoice();
//The following sleep interferes with pcsx2, disable it for now (rama)
//Sleep(50); // give the engine some time to stop voices
pSourceVoice = NULL;
voiceContext.pSourceVoice = NULL;
voiceContext.sndout = NULL;
voiceContext.pSourceVoice = NULL;
pSourceVoice = NULL;
}
Sleep(50); // give the engine some more time, because I don't trust it.
Sleep(10); // give the engine some more time, because I don't trust it.
//
// Cleanup XAudio2