From d89e7c84fbd938dc9f2265363334ec46c4cb321f Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Sat, 25 Jan 2025 14:06:55 -0500 Subject: CMakeLists: Add flag to disable Cubeb --- Source/Core/AudioCommon/AudioCommon.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Source/Core/AudioCommon/AudioCommon.cpp') diff --git a/Source/Core/AudioCommon/AudioCommon.cpp b/Source/Core/AudioCommon/AudioCommon.cpp index d9fee4ef72..0a0aafd307 100644 --- a/Source/Core/AudioCommon/AudioCommon.cpp +++ b/Source/Core/AudioCommon/AudioCommon.cpp @@ -28,7 +28,7 @@ constexpr int AUDIO_VOLUME_MAX = 100; static std::unique_ptr CreateSoundStreamForBackend(std::string_view backend) { - if (backend == BACKEND_CUBEB) + if (backend == BACKEND_CUBEB && CubebStream::IsValid()) return std::make_unique(); else if (backend == BACKEND_OPENAL && OpenALStream::IsValid()) return std::make_unique(); @@ -100,10 +100,11 @@ std::string GetDefaultSoundBackend() #elif defined __linux__ if (AlsaSound::IsValid()) backend = BACKEND_ALSA; - else + else if (CubebStream::IsValid()) backend = BACKEND_CUBEB; #elif defined(__APPLE__) || defined(_WIN32) || defined(__OpenBSD__) - backend = BACKEND_CUBEB; + if (CubebStream::IsValid()) + backend = BACKEND_CUBEB; #endif return backend; } @@ -118,7 +119,8 @@ std::vector GetSoundBackends() std::vector backends; backends.emplace_back(BACKEND_NULLSOUND); - backends.emplace_back(BACKEND_CUBEB); + if (CubebStream::IsValid()) + backends.emplace_back(BACKEND_CUBEB); if (AlsaSound::IsValid()) backends.emplace_back(BACKEND_ALSA); if (PulseAudio::IsValid()) -- cgit v1.2.3