SPU2: Don't initialise sound buffer if it's not open

This commit is contained in:
refractionpcsx2 2021-08-31 12:56:37 +01:00
parent 4dc0db6ee6
commit ef9c8ce877
1 changed files with 11 additions and 8 deletions

View File

@ -46,15 +46,18 @@ void SPU2configure()
configure(); configure();
try if (IsOpened)
{ {
Console.Warning("SPU2: Sound output module reset"); try
SndBuffer::Init(); {
} Console.Warning("SPU2: Sound output module reset");
catch (std::exception& ex) SndBuffer::Init();
{ }
fprintf(stderr, "SPU2 Error: Could not initialize device, or something.\nReason: %s", ex.what()); catch (std::exception& ex)
SPU2close(); {
fprintf(stderr, "SPU2 Error: Could not initialize device, or something.\nReason: %s", ex.what());
SPU2close();
}
} }
paused_core.AllowResume(); paused_core.AllowResume();
} }