]> granicus.if.org Git - esp-idf/commitdiff
component/bt: bugfix for incorrect computation of PCM data buffer size in A2DP sink
authorwangmengyang <wangmengyang@espressif.com>
Tue, 21 Aug 2018 11:27:04 +0000 (19:27 +0800)
committerbot <bot@espressif.com>
Mon, 27 Aug 2018 02:53:59 +0000 (02:53 +0000)
components/bt/bluedroid/btc/profile/std/a2dp/btc_a2dp_sink.c

index faf23eefc7d4bacc6e9b90d7807c5f77df7816e5..729237ed7bfa276a96e5737bed364a09b7285bf3 100644 (file)
@@ -586,7 +586,7 @@ static void btc_a2dp_sink_handle_inc_media(tBT_SBC_HDR *p_msg)
     OI_STATUS status;
     int num_sbc_frames = p_msg->num_frames_to_be_processed;
     UINT32 sbc_frame_len = p_msg->len - 1;
-    availPcmBytes = 2 * sizeof(pcmData);
+    availPcmBytes = sizeof(pcmData);
 
     /* XXX: Check if the below check is correct, we are checking for peer to be sink when we are sink */
     if (btc_av_get_peer_sep() == AVDT_TSEP_SNK || (btc_aa_snk_cb.rx_flush)) {
@@ -617,7 +617,7 @@ static void btc_a2dp_sink_handle_inc_media(tBT_SBC_HDR *p_msg)
         p_msg->len = sbc_frame_len + 1;
     }
 
-    btc_a2d_data_cb_to_app((uint8_t *)pcmData, (2 * sizeof(pcmData) - availPcmBytes));
+    btc_a2d_data_cb_to_app((uint8_t *)pcmData, (sizeof(pcmData) - availPcmBytes));
 }
 
 /*******************************************************************************