diff options
author | Eric Laurent <elaurent@google.com> | 2012-02-27 16:35:30 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-02-27 16:35:30 -0800 |
commit | 400ef2023badece85a18accb94194ed601ba6d72 (patch) | |
tree | 4be3c1230d2501d77d58b773eccb3c8426f240af /media | |
parent | 843a12d146bd64642bf85a4e56c274246e3893a6 (diff) | |
parent | 76533e94500e5d221ec4a1a5d9c97ea3d75860e4 (diff) | |
download | frameworks_av-400ef2023badece85a18accb94194ed601ba6d72.zip frameworks_av-400ef2023badece85a18accb94194ed601ba6d72.tar.gz frameworks_av-400ef2023badece85a18accb94194ed601ba6d72.tar.bz2 |
Merge "audio preprocessing: fix multiple enable problem"
Diffstat (limited to 'media')
-rwxr-xr-x | media/libeffects/preprocessing/PreProcessing.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/media/libeffects/preprocessing/PreProcessing.cpp b/media/libeffects/preprocessing/PreProcessing.cpp index 098a1a2..dc27d38 100755 --- a/media/libeffects/preprocessing/PreProcessing.cpp +++ b/media/libeffects/preprocessing/PreProcessing.cpp @@ -845,6 +845,17 @@ int Session_SetConfig(preproc_session_t *session, effect_config_t *config) config->inputCfg.samplingRate, config->inputCfg.channels); int status; + // if at least one process is enabled, do not accept configuration changes + if (session->enabledMsk) { + if (session->samplingRate != config->inputCfg.samplingRate || + session->inChannelCount != inCnl || + session->outChannelCount != outCnl) { + return -ENOSYS; + } else { + return 0; + } + } + // AEC implementation is limited to 16kHz if (config->inputCfg.samplingRate >= 32000 && !(session->createdMsk & (1 << PREPROC_AEC))) { session->apmSamplingRate = 32000; @@ -1287,7 +1298,9 @@ int PreProcessingFx_Command(effect_handle_t self, if (*(int *)pReplyData != 0) { break; } - *(int *)pReplyData = Effect_SetState(effect, PREPROC_EFFECT_STATE_CONFIG); + if (effect->state != PREPROC_EFFECT_STATE_ACTIVE) { + *(int *)pReplyData = Effect_SetState(effect, PREPROC_EFFECT_STATE_CONFIG); + } break; case EFFECT_CMD_GET_CONFIG: |