summaryrefslogtreecommitdiffstats
path: root/src/audio_core/audio_core.cpp
diff options
context:
space:
mode:
authorMerryMage <MerryMage@users.noreply.github.com>2016-12-10 02:06:53 +0100
committerMerryMage <MerryMage@users.noreply.github.com>2016-12-10 02:26:22 +0100
commitcef0f5b5a738c1e2ef32efd6c1010f5d97457d56 (patch)
tree0aac24b1331c325c7e630fb1287e99661c495791 /src/audio_core/audio_core.cpp
parentMerge pull request #2241 from Subv/clang_format (diff)
downloadyuzu-cef0f5b5a738c1e2ef32efd6c1010f5d97457d56.tar
yuzu-cef0f5b5a738c1e2ef32efd6c1010f5d97457d56.tar.gz
yuzu-cef0f5b5a738c1e2ef32efd6c1010f5d97457d56.tar.bz2
yuzu-cef0f5b5a738c1e2ef32efd6c1010f5d97457d56.tar.lz
yuzu-cef0f5b5a738c1e2ef32efd6c1010f5d97457d56.tar.xz
yuzu-cef0f5b5a738c1e2ef32efd6c1010f5d97457d56.tar.zst
yuzu-cef0f5b5a738c1e2ef32efd6c1010f5d97457d56.zip
Diffstat (limited to 'src/audio_core/audio_core.cpp')
-rw-r--r--src/audio_core/audio_core.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/audio_core/audio_core.cpp b/src/audio_core/audio_core.cpp
index 49260de7c..1065e2222 100644
--- a/src/audio_core/audio_core.cpp
+++ b/src/audio_core/audio_core.cpp
@@ -56,22 +56,17 @@ void AddAddressSpace(Kernel::VMManager& address_space) {
}
void SelectSink(std::string sink_id) {
- if (sink_id == "auto") {
- // Auto-select.
- // g_sink_details is ordered in terms of desirability, with the best choice at the front.
- const auto& sink_detail = g_sink_details.front();
- DSP::HLE::SetSink(sink_detail.factory());
- return;
- }
-
auto iter =
std::find_if(g_sink_details.begin(), g_sink_details.end(),
[sink_id](const auto& sink_detail) { return sink_detail.id == sink_id; });
- if (iter == g_sink_details.end()) {
- LOG_ERROR(Audio, "AudioCore::SelectSink given invalid sink_id");
- DSP::HLE::SetSink(std::make_unique<NullSink>());
- return;
+ if (sink_id == "auto" || iter == g_sink_details.end()) {
+ if (sink_id != "auto") {
+ LOG_ERROR(Audio, "AudioCore::SelectSink given invalid sink_id %s", sink_id.c_str());
+ }
+ // Auto-select.
+ // g_sink_details is ordered in terms of desirability, with the best choice at the front.
+ iter = g_sink_details.begin();
}
DSP::HLE::SetSink(iter->factory());