mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 09:39:10 -04:00
Merge branch 'bugfix/hfp_disc_audio_err' into 'master'
bugfix/fix_err_when_ag_disc_audio Closes IDFGH-6239 See merge request espressif/esp-idf!16920
This commit is contained in:
commit
94a62a1b50
@ -219,11 +219,14 @@ static void bt_app_send_data_task(void *arg)
|
||||
s_us_duration = s_now_enter_time - s_last_enter_time;
|
||||
if(s_audio_code == ESP_HF_AUDIO_STATE_CONNECTED_MSBC) {
|
||||
// time of a frame is 7.5ms, sample is 120, data is 2 (byte/sample), so a frame is 240 byte (HF_SBC_ENC_RAW_DATA_SIZE)
|
||||
frame_data_num = s_us_duration / (PCM_BLOCK_DURATION_US / WBS_PCM_INPUT_DATA_SIZE);
|
||||
s_last_enter_time += frame_data_num * (PCM_BLOCK_DURATION_US / WBS_PCM_INPUT_DATA_SIZE);
|
||||
frame_data_num = s_us_duration / PCM_BLOCK_DURATION_US * WBS_PCM_INPUT_DATA_SIZE;
|
||||
s_last_enter_time += frame_data_num / WBS_PCM_INPUT_DATA_SIZE * PCM_BLOCK_DURATION_US;
|
||||
} else {
|
||||
frame_data_num = s_us_duration / (PCM_BLOCK_DURATION_US / PCM_INPUT_DATA_SIZE);
|
||||
s_last_enter_time += frame_data_num * (PCM_BLOCK_DURATION_US / PCM_INPUT_DATA_SIZE);
|
||||
frame_data_num = s_us_duration / PCM_BLOCK_DURATION_US * PCM_INPUT_DATA_SIZE;
|
||||
s_last_enter_time += frame_data_num / PCM_INPUT_DATA_SIZE * PCM_BLOCK_DURATION_US;
|
||||
}
|
||||
if (frame_data_num == 0) {
|
||||
continue;
|
||||
}
|
||||
buf = osi_malloc(frame_data_num);
|
||||
if (!buf) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user