From 991b3ba8c2543ccfc08a89929e44e6e8a33ce559 Mon Sep 17 00:00:00 2001 From: Silent Date: Sat, 17 Aug 2019 11:15:46 +0200 Subject: [PATCH] AudioCommon/WASAPI: Remove thread unsafe nullptr checks giving a false sense of safety --- Source/Core/AudioCommon/WASAPIStream.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Source/Core/AudioCommon/WASAPIStream.cpp b/Source/Core/AudioCommon/WASAPIStream.cpp index 2ee39f668c..9be46cb751 100644 --- a/Source/Core/AudioCommon/WASAPIStream.cpp +++ b/Source/Core/AudioCommon/WASAPIStream.cpp @@ -353,17 +353,11 @@ void WASAPIStream::SoundLoop() Common::SetCurrentThreadName("WASAPI Handler"); BYTE* data; - if (m_audio_renderer) - { - m_audio_renderer->GetBuffer(m_frames_in_buffer, &data); - m_audio_renderer->ReleaseBuffer(m_frames_in_buffer, AUDCLNT_BUFFERFLAGS_SILENT); - } + m_audio_renderer->GetBuffer(m_frames_in_buffer, &data); + m_audio_renderer->ReleaseBuffer(m_frames_in_buffer, AUDCLNT_BUFFERFLAGS_SILENT); while (m_running.load(std::memory_order_relaxed)) { - if (!m_audio_renderer) - continue; - WaitForSingleObject(m_need_data_event.get(), 1000); m_audio_renderer->GetBuffer(m_frames_in_buffer, &data);