output/wasapi: eliminate kErrorId

This commit is contained in:
Max Kellermann 2021-03-08 17:46:58 +01:00
parent cd53ca22c6
commit 4833d0891d

View File

@ -147,8 +147,6 @@ void SetDSDFallback(AudioFormat &audio_format) noexcept {
} }
#endif #endif
inline constexpr const unsigned int kErrorId = -1;
} // namespace } // namespace
class WasapiOutputThread : public Thread { class WasapiOutputThread : public Thread {
@ -637,8 +635,8 @@ void WasapiOutput::OpenDevice() {
} }
} }
unsigned int id = kErrorId;
if (!device_config.empty()) { if (!device_config.empty()) {
unsigned int id;
if (!SafeSilenceTry([this, &id]() { id = std::stoul(device_config); })) { if (!SafeSilenceTry([this, &id]() { id = std::stoul(device_config); })) {
device = SearchDevice(device_config); device = SearchDevice(device_config);
if (!device) if (!device)