From 1c5441aa40eb81e51682477921c02ad21cf57aa9 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 10 Oct 2019 00:07:25 +1000 Subject: [PATCH 1/2] AlsaSoundStream: Don't call join() on invalid thread This can happen if initialization failed. --- Source/Core/AudioCommon/AlsaSoundStream.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/AudioCommon/AlsaSoundStream.cpp b/Source/Core/AudioCommon/AlsaSoundStream.cpp index d249640d1b..44f47400d9 100644 --- a/Source/Core/AudioCommon/AlsaSoundStream.cpp +++ b/Source/Core/AudioCommon/AlsaSoundStream.cpp @@ -25,7 +25,8 @@ AlsaSound::~AlsaSound() // Give the opportunity to the audio thread // to realize we are stopping the emulation cv.notify_one(); - thread.join(); + if (thread.joinable()) + thread.join(); } bool AlsaSound::Init() From 7c286064b85edeb9a53916fbd2add76ef60bc5a5 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 10 Oct 2019 00:09:16 +1000 Subject: [PATCH 2/2] AudioCommon: Don't forget to call Init() on fallback --- Source/Core/AudioCommon/AudioCommon.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Core/AudioCommon/AudioCommon.cpp b/Source/Core/AudioCommon/AudioCommon.cpp index dd9986077e..a8f09c2688 100644 --- a/Source/Core/AudioCommon/AudioCommon.cpp +++ b/Source/Core/AudioCommon/AudioCommon.cpp @@ -64,6 +64,7 @@ void InitSoundStream() WARN_LOG(AUDIO, "Could not initialize backend %s, using %s instead.", backend.c_str(), BACKEND_NULLSOUND); g_sound_stream = std::make_unique(); + g_sound_stream->Init(); } UpdateSoundStream();