]> code.delx.au - pulseaudio/commitdiff
Fix block_size calculation
authorJoão Paulo Rechi Vita <joao.vita@gmail.com>
Sun, 17 Aug 2008 04:54:12 +0000 (01:54 -0300)
committerLennart Poettering <lennart@poettering.net>
Wed, 10 Sep 2008 22:12:07 +0000 (01:12 +0300)
src/modules/module-bt-device.c

index 87d6ea60c4ec73b59af97ce7e2860b970fd745ac..4fb4fd792709f5929e2b86af6f53bd7fd849e7a7 100644 (file)
@@ -445,17 +445,16 @@ static int bt_setconf(struct userdata *u) {
 
     u->transport = setconf_rsp->transport;
     u->link_mtu = setconf_rsp->link_mtu;
-    if (u->transport == BT_CAPABILITIES_TRANSPORT_A2DP)
-        /* TODO: Check the max possible size */ u->block_size = u->link_mtu / 2;
-    else
-        u->block_size = u->link_mtu;
 
     /* setup SBC encoder now we agree on parameters */
     if (u->transport == BT_CAPABILITIES_TRANSPORT_A2DP) {
         bt_a2dp_setup(&u->a2dp);
+        u->block_size = u->a2dp.codesize;
         pa_log/*debug*/("\tallocation=%u\n\tsubbands=%u\n\tblocks=%u\n\tbitpool=%u\n",
                 u->a2dp.sbc.allocation, u->a2dp.sbc.subbands, u->a2dp.sbc.blocks, u->a2dp.sbc.bitpool);
     }
+    else
+        u->block_size = u->link_mtu;
 
     return 0;
 }