mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
fix(bt/avdtp): Reject SET CONFIGURATION command with error code INVALID_CODEC_TYPE
1: reset p_scb->avdt_handle in cleanup function. 2: cancel comparing p_scb->codec_type and p_scb->seps[xx].codec_type to send the error INVALID_CODEC_TYPE.
This commit is contained in:
committed by
gongyantao
parent
c9c7322678
commit
08be89bd3e
@ -727,8 +727,7 @@ static void bta_av_adjust_seps_idx(tBTA_AV_SCB *p_scb, UINT8 avdt_handle)
|
|||||||
for (xx = 0; xx < BTA_AV_MAX_SEPS; xx++) {
|
for (xx = 0; xx < BTA_AV_MAX_SEPS; xx++) {
|
||||||
APPL_TRACE_DEBUG("av_handle: %d codec_type: %d",
|
APPL_TRACE_DEBUG("av_handle: %d codec_type: %d",
|
||||||
p_scb->seps[xx].av_handle, p_scb->seps[xx].codec_type);
|
p_scb->seps[xx].av_handle, p_scb->seps[xx].codec_type);
|
||||||
if ((p_scb->seps[xx].av_handle && p_scb->codec_type == p_scb->seps[xx].codec_type)
|
if ((p_scb->seps[xx].av_handle) && (p_scb->seps[xx].av_handle == avdt_handle)) {
|
||||||
&& (p_scb->seps[xx].av_handle == avdt_handle)) {
|
|
||||||
p_scb->sep_idx = xx;
|
p_scb->sep_idx = xx;
|
||||||
p_scb->avdt_handle = p_scb->seps[xx].av_handle;
|
p_scb->avdt_handle = p_scb->seps[xx].av_handle;
|
||||||
break;
|
break;
|
||||||
@ -1021,6 +1020,7 @@ void bta_av_cleanup(tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
|
|||||||
p_scb->wait = 0;
|
p_scb->wait = 0;
|
||||||
p_scb->num_disc_snks = 0;
|
p_scb->num_disc_snks = 0;
|
||||||
p_scb->disc_rsn = 0;
|
p_scb->disc_rsn = 0;
|
||||||
|
p_scb->avdt_handle = 0;
|
||||||
bta_sys_stop_timer(&p_scb->timer);
|
bta_sys_stop_timer(&p_scb->timer);
|
||||||
if (p_scb->deregistring) {
|
if (p_scb->deregistring) {
|
||||||
/* remove stream */
|
/* remove stream */
|
||||||
|
Reference in New Issue
Block a user