]> code.delx.au - pulseaudio/commitdiff
bluetooth: don't busy loop when device is not writable but we want to write
authorLennart Poettering <lennart@poettering.net>
Wed, 1 Jul 2009 00:21:17 +0000 (02:21 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 1 Jul 2009 00:21:17 +0000 (02:21 +0200)
src/modules/bluetooth/module-bluetooth-device.c

index e7c6d5e404028da0f2d14932513ca24ff7aac924..c46518e194219ac350a071841e9ee9a8dc8976f8 100644 (file)
@@ -1355,7 +1355,7 @@ static void thread_func(void *userdata) {
                     writable = FALSE;
                 }
 
-                if ((!u->source || !PA_SOURCE_IS_LINKED(u->source->thread_info.state)) && do_write <= 0) {
+                if ((!u->source || !PA_SOURCE_IS_LINKED(u->source->thread_info.state)) && do_write <= 0 && writable) {
                     pa_usec_t time_passed, next_write_at, sleep_for;
 
                     /* Hmm, there is no input stream we could synchronize