diff options
author | Max Kellermann <max@musicpd.org> | 2021-03-10 17:44:55 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2021-03-10 17:45:54 +0100 |
commit | 2ac2bd26f85d08c0b3156409e421aea5bf71e2f3 (patch) | |
tree | 5c529a5827054c4ab867d7dc230d5fdb40e6b97a | |
parent | a2be91aea580cc08c0f551d3a598132f799e43bc (diff) |
output/wasapi: combine two `if` statements to one `switch`
-rw-r--r-- | src/output/plugins/wasapi/WasapiOutputPlugin.cxx | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx index 7a58ffe2e..7092deb92 100644 --- a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx +++ b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx @@ -354,16 +354,23 @@ try { event.Wait(); Status current_state = status.load(); - if (current_state == Status::FINISH) { + switch (current_state) { + case Status::FINISH: FormatDebug(wasapi_output_domain, "Working thread stopped"); return; - } - if (!started && current_state != Status::PLAY) - /* don't bother starting the IAudioClient if - we're paused */ - continue; + case Status::PAUSE: + if (!started) + /* don't bother starting the + IAudioClient if we're paused */ + continue; + + break; + + case Status::PLAY: + break; + } UINT32 write_in_frames = buffer_size_in_frames; if (!is_exclusive) { |