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.
This commit is contained in:
Pauli Virtanen 2021-03-09 02:37:42 +02:00 committed by Wim Taymans
parent e095105e57
commit 808b54bc19

View file

@ -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) {