Fixed stop of DSP HLE+LLE and some clean up(reset all variables in DSound creation)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2760 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee
2009-03-27 11:06:52 +00:00
parent b5b42746ed
commit bffe311b3e
6 changed files with 117 additions and 103 deletions

View File

@ -217,23 +217,30 @@ void Initialize(void *init)
void DSP_StopSoundStream()
{
// fprintf(stderr, "in dsp stop\n");
/*
if (!soundStream)
PanicAlert("Can't stop non running SoundStream!");
soundStream->Stop();
delete soundStream;
soundStream = NULL;
// fprintf(stderr, "in dsp stop end\n");
*/
}
void Shutdown()
{
// FIXME: called before stop is finished????
// fprintf(stderr, "in dsp shutdown\n");
NOTICE_LOG(DSPHLE, "Shutting down DSP plugin");
if (soundStream) {
soundStream->Stop();
delete soundStream;
soundStream = NULL;
}
// Check that soundstream already is stopped.
if (soundStream)
PanicAlert("SoundStream alive in DSP::Shutdown!");
while (soundStream) {
ERROR_LOG(DSPHLE, "Waiting for sound stream");
Common::SleepCurrentThread(2000);
}
// Stop the sound recording
if (log_ai)
@ -252,6 +259,7 @@ void Shutdown()
m_frame->sMailEnd.clear();
}
#endif
INFO_LOG(DSPHLE, "Done shutting down DSP plugin");
}
void DoState(unsigned char **ptr, int mode)