From ef9c8ce8772050fc90089b013c5ce5eba506d85f Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Tue, 31 Aug 2021 12:56:37 +0100 Subject: [PATCH] SPU2: Don't initialise sound buffer if it's not open --- pcsx2/SPU2/spu2.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pcsx2/SPU2/spu2.cpp b/pcsx2/SPU2/spu2.cpp index e9a81a0143..de011b9aa0 100644 --- a/pcsx2/SPU2/spu2.cpp +++ b/pcsx2/SPU2/spu2.cpp @@ -46,15 +46,18 @@ void SPU2configure() configure(); - try + if (IsOpened) { - Console.Warning("SPU2: Sound output module reset"); - SndBuffer::Init(); - } - catch (std::exception& ex) - { - fprintf(stderr, "SPU2 Error: Could not initialize device, or something.\nReason: %s", ex.what()); - SPU2close(); + try + { + Console.Warning("SPU2: Sound output module reset"); + SndBuffer::Init(); + } + catch (std::exception& ex) + { + fprintf(stderr, "SPU2 Error: Could not initialize device, or something.\nReason: %s", ex.what()); + SPU2close(); + } } paused_core.AllowResume(); }