Commit 17d4873b authored by Max Kellermann's avatar Max Kellermann

output/wasapi: use default device only if none was configured

parent 8b41c4f3
...@@ -7,6 +7,7 @@ ver 0.22.7 (not yet released) ...@@ -7,6 +7,7 @@ ver 0.22.7 (not yet released)
- curl: don't use glibc extension - curl: don't use glibc extension
* output * output
- wasapi: add algorithm for finding usable audio format - wasapi: add algorithm for finding usable audio format
- wasapi: use default device only if none was configured
ver 0.22.6 (2021/02/16) ver 0.22.6 (2021/02/16)
* fix missing tags on songs in queue * fix missing tags on songs in queue
......
...@@ -617,14 +617,13 @@ void WasapiOutput::OpenDevice() { ...@@ -617,14 +617,13 @@ void WasapiOutput::OpenDevice() {
if (!device_config.empty()) { if (!device_config.empty()) {
if (!SafeSilenceTry([this, &id]() { id = std::stoul(device_config); })) { if (!SafeSilenceTry([this, &id]() { id = std::stoul(device_config); })) {
id = SearchDevice(device_config); id = SearchDevice(device_config);
} if (id == kErrorId)
} throw FormatRuntimeError("Device '%s' not found",
device_config.c_str());
if (id != kErrorId) {
SafeTry([this, id]() { GetDevice(id); });
} }
if (!device) { GetDevice(id);
} else {
device = GetDefaultAudioEndpoint(*enumerator); device = GetDefaultAudioEndpoint(*enumerator);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment