diff options
| author | Florent Castelli <florent.castelli@gmail.com> | 2017-02-05 00:57:42 +0100 |
|---|---|---|
| committer | Florent Castelli <florent.castelli@gmail.com> | 2017-02-05 02:55:04 +0100 |
| commit | 31dfaafe0b2b99e7724f4c9c6b40e7021554ef11 (patch) | |
| tree | c053d5d82bc66cffc8fe43448d5a93137fd9059b /Source/Core/AudioCommon/AudioCommon.cpp | |
| parent | ee8a21f1d0a0a0e63e996ae1f8e1aa03513dc22a (diff) | |
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.
Diffstat (limited to 'Source/Core/AudioCommon/AudioCommon.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/AudioCommon.cpp | 7 |
1 files 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<OpenALStream>(); - else if (backend == BACKEND_NULLSOUND && NullSound::isValid()) + else if (backend == BACKEND_NULLSOUND) g_sound_stream = std::make_unique<NullSound>(); else if (backend == BACKEND_XAUDIO2) { @@ -53,7 +53,7 @@ void InitSoundStream() else if (backend == BACKEND_OPENSLES && OpenSLESStream::isValid()) g_sound_stream = std::make_unique<OpenSLESStream>(); - 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<std::string> GetSoundBackends() { std::vector<std::string> 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()) |
