From 808b54bc197120e0a1cf705b746448e31e37a178 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Tue, 9 Mar 2021 02:37:42 +0200 Subject: [PATCH] bluez5: sco-io: fallback packet size when read size unknown should be even Reported write MTU is odd for some adapters, which will misalign CVSD frames, so round fallback value to even. --- spa/plugins/bluez5/sco-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/plugins/bluez5/sco-io.c b/spa/plugins/bluez5/sco-io.c index 29720384e..294b0cb0e 100644 --- a/spa/plugins/bluez5/sco-io.c +++ b/spa/plugins/bluez5/sco-io.c @@ -186,7 +186,7 @@ int spa_bt_sco_io_write(struct spa_bt_sco_io *io, uint8_t *buf, int size) uint16_t packet_size; uint8_t *buf_start = buf; - packet_size = (io->read_size > 0) ? SPA_MIN(io->write_mtu, io->read_size) : io->write_mtu; + packet_size = (io->read_size > 0) ? SPA_MIN(io->write_mtu, io->read_size) : (io->write_mtu / 2) * 2; spa_assert(packet_size > 0); if (size < packet_size) {