output/wasapi: use default device only if none was configured
This commit is contained in:
parent
8b41c4f384
commit
17d4873b60
1
NEWS
1
NEWS
|
@ -7,6 +7,7 @@ ver 0.22.7 (not yet released)
|
|||
- curl: don't use glibc extension
|
||||
* output
|
||||
- wasapi: add algorithm for finding usable audio format
|
||||
- wasapi: use default device only if none was configured
|
||||
|
||||
ver 0.22.6 (2021/02/16)
|
||||
* fix missing tags on songs in queue
|
||||
|
|
|
@ -617,14 +617,13 @@ void WasapiOutput::OpenDevice() {
|
|||
if (!device_config.empty()) {
|
||||
if (!SafeSilenceTry([this, &id]() { id = std::stoul(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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue