Commit 223c129b authored by Max Kellermann's avatar Max Kellermann

output/pulse: simplify _wait_for_operation()

Eliminate the duplicate pa_operation_get_state() call.
parent 60589fc1
...@@ -148,16 +148,13 @@ static bool ...@@ -148,16 +148,13 @@ static bool
pulse_wait_for_operation(struct pa_threaded_mainloop *mainloop, pulse_wait_for_operation(struct pa_threaded_mainloop *mainloop,
struct pa_operation *operation) struct pa_operation *operation)
{ {
pa_operation_state_t state;
assert(mainloop != nullptr); assert(mainloop != nullptr);
assert(operation != nullptr); assert(operation != nullptr);
state = pa_operation_get_state(operation); pa_operation_state_t state;
while (state == PA_OPERATION_RUNNING) { while ((state = pa_operation_get_state(operation))
== PA_OPERATION_RUNNING)
pa_threaded_mainloop_wait(mainloop); pa_threaded_mainloop_wait(mainloop);
state = pa_operation_get_state(operation);
}
pa_operation_unref(operation); pa_operation_unref(operation);
......
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