]> code.delx.au - pulseaudio/commitdiff
Fix sending wrong codec capability length.
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>
Tue, 6 Jan 2009 14:02:16 +0000 (11:02 -0300)
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>
Tue, 6 Jan 2009 14:02:16 +0000 (11:02 -0300)
src/modules/bluetooth/module-bluetooth-device.c

index 2546c694927765a8c30462acd422962a4a4ba021..cb4746a4d7efc0d9268064e77123109845a055c9 100644 (file)
@@ -458,9 +458,12 @@ static int bt_setconf(struct userdata *u) {
 
     strncpy(msg.setconf_req.device, u->addr, 18);
     msg.setconf_req.codec.transport = u->transport;
-    if (u->transport == BT_CAPABILITIES_TRANSPORT_A2DP)
+    if (u->transport == BT_CAPABILITIES_TRANSPORT_A2DP) {
         memcpy(&msg.setconf_req.codec, &u->a2dp.sbc_capabilities,
                 sizeof(u->a2dp.sbc_capabilities));
+        msg.setconf_req.h.length += msg.setconf_req.codec.length
+                                    - sizeof(msg.setconf_req.codec);
+    }
     msg.setconf_req.access_mode = BT_CAPABILITIES_ACCESS_MODE_WRITE;
 
     e = bt_audioservice_send(u->audioservice_fd, &msg.setconf_req.h);