]> code.delx.au - pulseaudio/commitdiff
simple: check for == RUNNING instead of != DONE when waiting for operations
authorLennart Poettering <lennart@poettering.net>
Tue, 4 Aug 2009 23:05:35 +0000 (01:05 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 4 Aug 2009 23:05:35 +0000 (01:05 +0200)
src/pulse/simple.c

index 1e0f3e1854ccc3965f21a8659f494087a8dfff90..9ed7a6535802180e9f4f68e83e3636ea635df069 100644 (file)
@@ -392,7 +392,7 @@ int pa_simple_drain(pa_simple *p, int *rerror) {
     CHECK_SUCCESS_GOTO(p, rerror, o, unlock_and_fail);
 
     p->operation_success = 0;
-    while (pa_operation_get_state(o) != PA_OPERATION_DONE) {
+    while (pa_operation_get_state(o) == PA_OPERATION_RUNNING) {
         pa_threaded_mainloop_wait(p->mainloop);
         CHECK_DEAD_GOTO(p, rerror, unlock_and_fail);
     }
@@ -428,7 +428,7 @@ int pa_simple_flush(pa_simple *p, int *rerror) {
     CHECK_SUCCESS_GOTO(p, rerror, o, unlock_and_fail);
 
     p->operation_success = 0;
-    while (pa_operation_get_state(o) != PA_OPERATION_DONE) {
+    while (pa_operation_get_state(o) == PA_OPERATION_RUNNING) {
         pa_threaded_mainloop_wait(p->mainloop);
         CHECK_DEAD_GOTO(p, rerror, unlock_and_fail);
     }