output/wasapi: check AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED

Stop early, don't try more formats if it is clear that we have no
chance.
This commit is contained in:
Max Kellermann 2021-03-05 19:33:22 +01:00
parent fc20a1f10a
commit 93016ac6ab
1 changed files with 3 additions and 0 deletions

View File

@ -642,6 +642,9 @@ bool WasapiOutput::TryFormatExclusive(const AudioFormat &audio_format) {
device_format = test_format;
return true;
}
if (result == AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED)
throw std::runtime_error("Exclusive mode not allowed");
}
return false;
}