hci: assume 2-bytes per SCO sample only if input sample size is 16-bit

This commit is contained in:
Matthias Ringwald 2023-05-24 14:43:30 +02:00
parent d552970049
commit 73f498e7b8

View File

@ -9075,7 +9075,14 @@ uint16_t hci_get_sco_packet_length(void){
#ifdef ENABLE_SCO_OVER_HCI
// Transparent = mSBC => 1, CVSD with 16-bit samples requires twice as much bytes
int multiplier = ((hci_stack->sco_voice_setting_active & 0x03) == 0x03) ? 1 : 2;
int multiplier;
if (((hci_stack->sco_voice_setting_active & 0x03) != 0x03) &&
((hci_stack->sco_voice_setting_active & 0x20) == 0x20)) {
multiplier = 2;
} else {
multiplier = 1;
}
if (hci_have_usb_transport()){
// see Core Spec for H2 USB Transfer.