diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-07-22 01:35:23 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-07-22 01:35:23 +0000 |
commit | b53fcadb1b321a425a5e044c6037094c733b7894 (patch) | |
tree | 38d106abd6b15e8298f4bf6662170c871dc51f96 | |
parent | 5074c2f9bf2b7d80fb75aa8cf35d2eff76d72fb3 (diff) | |
parent | 7fe032bf56bac9adc920dec7ae0755f616c291bd (diff) | |
download | android_system_bt-b53fcadb1b321a425a5e044c6037094c733b7894.tar.gz android_system_bt-b53fcadb1b321a425a5e044c6037094c733b7894.tar.bz2 android_system_bt-b53fcadb1b321a425a5e044c6037094c733b7894.zip |
Merge "Revert "Always restrict the AVDTP MTU for SBC codec to MAX_2MBPS_AVDTP_MTU(663)"" into oc-dr1-dev
-rw-r--r-- | stack/a2dp/a2dp_sbc_encoder.cc | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/stack/a2dp/a2dp_sbc_encoder.cc b/stack/a2dp/a2dp_sbc_encoder.cc index 5d48c7903..e4c20499c 100644 --- a/stack/a2dp/a2dp_sbc_encoder.cc +++ b/stack/a2dp/a2dp_sbc_encoder.cc @@ -753,14 +753,21 @@ static uint8_t calculate_max_frames_per_packet(void) { LOG_VERBOSE(LOG_TAG, "%s: original AVDTP MTU size: %d", __func__, a2dp_sbc_encoder_cb.TxAaMtuSize); + if (a2dp_sbc_encoder_cb.is_peer_edr && + !a2dp_sbc_encoder_cb.peer_supports_3mbps) { + // This condition would be satisfied only if the remote device is + // EDR and supports only 2 Mbps, but the effective AVDTP MTU size + // exceeds the 2DH5 packet size. + LOG_VERBOSE(LOG_TAG, + "%s: The remote device is EDR but does not support 3 Mbps", + __func__); - // Restrict the MTU - even though some Sink devices are advertising large - // MTU, they are not able to handle the packets and are stuttering. - if (effective_mtu_size > MAX_2MBPS_AVDTP_MTU) { - LOG_WARN(LOG_TAG, "%s: Restricting AVDTP MTU size to %d", __func__, - MAX_2MBPS_AVDTP_MTU); - effective_mtu_size = MAX_2MBPS_AVDTP_MTU; - a2dp_sbc_encoder_cb.TxAaMtuSize = effective_mtu_size; + if (effective_mtu_size > MAX_2MBPS_AVDTP_MTU) { + LOG_WARN(LOG_TAG, "%s: Restricting AVDTP MTU size to %d", __func__, + MAX_2MBPS_AVDTP_MTU); + effective_mtu_size = MAX_2MBPS_AVDTP_MTU; + a2dp_sbc_encoder_cb.TxAaMtuSize = effective_mtu_size; + } } if (!p_encoder_params->s16NumOfSubBands) { |