Commit 9256190a authored by Max Kellermann's avatar Max Kellermann

output/wasapi: move catch block to the Work() function level

If an exception has been caught, the method cannot continue playback, therefore it doesn't make sense to have the "catch" block inside the "while" block (and not break the loop after catching an exception).
parent 3a0dbb0a
......@@ -317,12 +317,11 @@ wasapi_output_get_client(WasapiOutput &output) noexcept
inline void
WasapiOutputThread::Work() noexcept
{
try {
SetThreadName("Wasapi Output Worker");
FormatDebug(wasapi_output_domain, "Working thread started");
COM com;
while (true) {
try {
event.Wait();
Status current_state = status.load();
......@@ -368,12 +367,11 @@ WasapiOutputThread::Work() noexcept
FormatDebug(wasapi_output_domain,
"Working thread paused");
}
} catch (...) {
}
} catch (...) {
error.ptr = std::current_exception();
error.occur.store(true);
error.thrown.Wait();
}
}
}
AudioOutput *
......
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