fixed crash in I2S when reconnect to a2dp sink

This commit is contained in:
Jin Cheng 2022-09-28 18:02:59 +08:00
parent 755ce1077d
commit e59ec7e597

View File

@ -246,8 +246,8 @@ static void bt_av_hdl_a2d_evt(uint16_t event, void *p_param)
s_a2d_conn_state_str[a2d->conn_stat.state], bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]);
if (a2d->conn_stat.state == ESP_A2D_CONNECTION_STATE_DISCONNECTED) {
esp_bt_gap_set_scan_mode(ESP_BT_CONNECTABLE, ESP_BT_GENERAL_DISCOVERABLE);
bt_i2s_task_shut_down();
bt_i2s_driver_uninstall();
bt_i2s_task_shut_down();
} else if (a2d->conn_stat.state == ESP_A2D_CONNECTION_STATE_CONNECTED){
esp_bt_gap_set_scan_mode(ESP_BT_NON_CONNECTABLE, ESP_BT_NON_DISCOVERABLE);
bt_i2s_task_start_up();