diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2026-11-15 22:33:58 -0600 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2026-11-16 18:04:59 -0600 |
| commit | eaad965f5785a63112949535ce14798d32dd38bf (patch) | |
| tree | 9c3ac83e3fa4a57fef01d185f5e3796d0c74a152 /Source/Core/AudioCommon/CubebUtils.cpp | |
| parent | 8169c72ce63ba9315888fd05fe8a7885f93e6f4f (diff) | |
AudioCommon: Allow MAIN_AUDIO_BACKEND to optionally specify the Cubeb backend after a slash. e.g. "Cubeb/wasapi".
Diffstat (limited to 'Source/Core/AudioCommon/CubebUtils.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/CubebUtils.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/Core/AudioCommon/CubebUtils.cpp b/Source/Core/AudioCommon/CubebUtils.cpp index 4dc34a0d44..ff1a304880 100644 --- a/Source/Core/AudioCommon/CubebUtils.cpp +++ b/Source/Core/AudioCommon/CubebUtils.cpp @@ -10,6 +10,7 @@ #include "Common/Logging/Log.h" #include "Common/Logging/LogManager.h" #include "Common/StringUtil.h" +#include "Core/Config/MainSettings.h" #include <cubeb/cubeb.h> @@ -67,8 +68,15 @@ std::shared_ptr<cubeb> GetContext() ERROR_LOG_FMT(AUDIO, "Error setting cubeb log callback"); } + // Cubeb may have its own backend specified after a slash. + // e.g. "Cubeb/wasapi" + const auto audio_backend = Config::Get(Config::MAIN_AUDIO_BACKEND); + const auto cubeb_backend_delimiter_pos = audio_backend.find('/'); + const char* const backend_name = (cubeb_backend_delimiter_pos == std::string::npos) ? + nullptr : + audio_backend.c_str() + cubeb_backend_delimiter_pos + 1; cubeb* ctx; - if (cubeb_init(&ctx, "Dolphin Emulator", nullptr) != CUBEB_OK) + if (cubeb_init(&ctx, "Dolphin Emulator", backend_name) != CUBEB_OK) { ERROR_LOG_FMT(AUDIO, "Error initializing cubeb library"); return nullptr; |
