diff options
author | Max Kellermann <max@duempel.org> | 2014-09-05 11:16:09 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-09-05 11:16:09 +0200 |
commit | 223c129b6b710b60d885a4d26d036c2a314d10fc (patch) | |
tree | 857a99935be601b530ce8411e1a801f8add560ac | |
parent | 60589fc1cbc6ecaed80f3b590d02c4fccc674d90 (diff) | |
download | mpd-223c129b6b710b60d885a4d26d036c2a314d10fc.tar.gz mpd-223c129b6b710b60d885a4d26d036c2a314d10fc.tar.xz mpd-223c129b6b710b60d885a4d26d036c2a314d10fc.zip |
output/pulse: simplify _wait_for_operation()
Eliminate the duplicate pa_operation_get_state() call.
-rw-r--r-- | src/output/plugins/PulseOutputPlugin.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/output/plugins/PulseOutputPlugin.cxx b/src/output/plugins/PulseOutputPlugin.cxx index ec3725a71..120bad090 100644 --- a/src/output/plugins/PulseOutputPlugin.cxx +++ b/src/output/plugins/PulseOutputPlugin.cxx @@ -148,16 +148,13 @@ static bool pulse_wait_for_operation(struct pa_threaded_mainloop *mainloop, struct pa_operation *operation) { - pa_operation_state_t state; - assert(mainloop != nullptr); assert(operation != nullptr); - state = pa_operation_get_state(operation); - while (state == PA_OPERATION_RUNNING) { + pa_operation_state_t state; + while ((state = pa_operation_get_state(operation)) + == PA_OPERATION_RUNNING) pa_threaded_mainloop_wait(mainloop); - state = pa_operation_get_state(operation); - } pa_operation_unref(operation); |