bluetooth: when starting up HSP stream, send 2 packets first, only afterwards enter...
authorLennart Poettering <lennart@poettering.net>
Thu, 9 Apr 2009 23:31:25 +0000 (01:31 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 9 Apr 2009 23:31:30 +0000 (01:31 +0200)
src/modules/bluetooth/module-bluetooth-device.c

index 2812bc2..90f6486 100644 (file)
@@ -1268,6 +1268,12 @@ static void thread_func(void *userdata) {
 
         if (u->source && PA_SOURCE_IS_LINKED(u->source->thread_info.state)) {
 
+            /* We should send two blocks to the device before we expect
+             * a response. */
+
+            if (u->write_index == 0 && u->read_index <= 0)
+                do_write = 2;
+
             if (pollfd && (pollfd->revents & POLLIN)) {
                 int n_read;