From 1297999b1cdca6b1fffcfb52c486481f1ab6903b Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Tue, 5 Nov 2024 15:37:18 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8Dcat1=E7=94=B5=E8=AF=9D?= =?utf8?q?=E5=BC=82=E5=B8=B8Free=E5=AF=BC=E8=87=B4dsp=E6=8C=82=E6=8E=89?= =?utf8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../driver/audio/source/drv/aoe/drv_ao.c | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/code/sdk/drivers/drivers/driver/audio/source/drv/aoe/drv_ao.c b/code/sdk/drivers/drivers/driver/audio/source/drv/aoe/drv_ao.c index 3b8757c26..b767e2cf4 100755 --- a/code/sdk/drivers/drivers/driver/audio/source/drv/aoe/drv_ao.c +++ b/code/sdk/drivers/drivers/driver/audio/source/drv/aoe/drv_ao.c @@ -216,12 +216,6 @@ td_s32 sap_ioctl_ao_open(td_u32 cmd, td_void *arg, td_void *file) } #endif - ret = drv_ao_load_aef(); - if (ret != AUDIO_SUCCESS) { - sap_err_log_fun(drv_ao_load_aef, ret); - return ret; - } - audio_unused(cmd); audio_unused(file); return AUDIO_SUCCESS; @@ -628,7 +622,7 @@ static td_s32 ao_set_aef_param_by_profile(td_handle drv_ao, ao_attr *attr, ao_ae td_s32 ret; td_u32 lib_buf_size = AO_AEF_PARAM_SIZE_MMZ_MAX; td_u8 *lib_buf = (td_u8 *)malloc(lib_buf_size); - if (lib_buf == TD_NULL) { + if (lib_buf == TD_NULL) { return ERR_AO_NULL_PTR; } @@ -664,16 +658,27 @@ td_s32 sap_ioctl_ao_set_aef_profile(td_u32 cmd, td_void *arg, td_void *file) td_handle drv_ao; ao_attr attr = {0}; sap_ao_port_aef_profile *profile = TD_NULL; - + profile = (sap_ao_port_aef_profile *)arg; drv_ao = profile->h_mod; + + if (profile->aef_profile > AO_AEF_PROFILE_NONE && profile->aef_profile < AO_AEF_PROFILE_MAX) + { + ret = drv_ao_load_aef(); + if (ret != AUDIO_SUCCESS) { + sap_err_log_fun(drv_ao_load_aef, ret); + return ret; + } + } + + ret = drv_msg_ao_set_aef_profile(drv_ao, profile->aef_profile); if (ret != AUDIO_SUCCESS) { sap_err_log_fun(drv_msg_ao_set_aef_profile, ret); return ret; } - + if (profile->aef_profile == AO_AEF_PROFILE_NONE || profile->aef_profile == AO_AEF_PROFILE_MAX) { return AUDIO_SUCCESS; } -- 2.17.1