From 31dfaafe0b2b99e7724f4c9c6b40e7021554ef11 Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Sun, 5 Feb 2017 00:57:42 +0100 Subject: [PATCH] AudioCommon: Remove checks against NullSound::isValid() The NullAudio backend is guaranteed to be compiled in, so no reason to check it. In addition to that, if it wasn't valid, it wouldn't work as a fallback in InitSoundStream as there are uses to g_sound_stream later. --- Source/Core/AudioCommon/AudioCommon.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/Core/AudioCommon/AudioCommon.cpp b/Source/Core/AudioCommon/AudioCommon.cpp index 0d0309a5c0..1ffb323a3f 100644 --- a/Source/Core/AudioCommon/AudioCommon.cpp +++ b/Source/Core/AudioCommon/AudioCommon.cpp @@ -33,7 +33,7 @@ void InitSoundStream() std::string backend = SConfig::GetInstance().sBackend; if (backend == BACKEND_OPENAL && OpenALStream::isValid()) g_sound_stream = std::make_unique(); - else if (backend == BACKEND_NULLSOUND && NullSound::isValid()) + else if (backend == BACKEND_NULLSOUND) g_sound_stream = std::make_unique(); else if (backend == BACKEND_XAUDIO2) { @@ -53,7 +53,7 @@ void InitSoundStream() else if (backend == BACKEND_OPENSLES && OpenSLESStream::isValid()) g_sound_stream = std::make_unique(); - if (!g_sound_stream && NullSound::isValid()) + if (!g_sound_stream) { WARN_LOG(AUDIO, "Could not initialize backend %s, using %s instead.", backend.c_str(), BACKEND_NULLSOUND); @@ -96,8 +96,7 @@ std::vector GetSoundBackends() { std::vector backends; - if (NullSound::isValid()) - backends.push_back(BACKEND_NULLSOUND); + backends.push_back(BACKEND_NULLSOUND); if (XAudio2_7::isValid() || XAudio2::isValid()) backends.push_back(BACKEND_XAUDIO2); if (AOSound::isValid())