Merge "post_proc: disable effect immediately when routed to invalid devices"

This commit is contained in:
Linux Build Service Account 2014-04-02 02:56:29 -07:00 committed by Gerrit - the friendly Code Review server
commit a3e12d6e1a
2 changed files with 22 additions and 2 deletions

View File

@ -160,12 +160,20 @@ int bassboost_set_device(effect_context_t *context, uint32_t device)
if (offload_bassboost_get_enable_flag(&(bass_ctxt->offload_bass))) {
offload_bassboost_set_enable_flag(&(bass_ctxt->offload_bass), false);
bass_ctxt->temp_disabled = true;
if (bass_ctxt->ctl)
offload_bassboost_send_params(bass_ctxt->ctl,
bass_ctxt->offload_bass,
OFFLOAD_SEND_BASSBOOST_ENABLE_FLAG);
}
} else {
if (!offload_bassboost_get_enable_flag(&(bass_ctxt->offload_bass)) &&
bass_ctxt->temp_disabled) {
offload_bassboost_set_enable_flag(&(bass_ctxt->offload_bass), true);
bass_ctxt->temp_disabled = false;
if (bass_ctxt->ctl)
offload_bassboost_send_params(bass_ctxt->ctl,
bass_ctxt->offload_bass,
OFFLOAD_SEND_BASSBOOST_ENABLE_FLAG);
}
}
offload_bassboost_set_device(&(bass_ctxt->offload_bass), device);
@ -214,7 +222,9 @@ int bassboost_enable(effect_context_t *context)
bassboost_context_t *bass_ctxt = (bassboost_context_t *)context;
ALOGV("%s", __func__);
if (!offload_bassboost_get_enable_flag(&(bass_ctxt->offload_bass))) {
if (!offload_bassboost_get_enable_flag(&(bass_ctxt->offload_bass)) &&
!(bass_ctxt->temp_disabled)) {
offload_bassboost_set_enable_flag(&(bass_ctxt->offload_bass), true);
if (bass_ctxt->ctl && bass_ctxt->strength)
offload_bassboost_send_params(bass_ctxt->ctl,

View File

@ -160,12 +160,20 @@ int virtualizer_set_device(effect_context_t *context, uint32_t device)
if (offload_virtualizer_get_enable_flag(&(virt_ctxt->offload_virt))) {
offload_virtualizer_set_enable_flag(&(virt_ctxt->offload_virt), false);
virt_ctxt->temp_disabled = true;
if (virt_ctxt->ctl)
offload_virtualizer_send_params(virt_ctxt->ctl,
virt_ctxt->offload_virt,
OFFLOAD_SEND_VIRTUALIZER_ENABLE_FLAG);
}
} else {
if (!offload_virtualizer_get_enable_flag(&(virt_ctxt->offload_virt)) &&
virt_ctxt->temp_disabled) {
offload_virtualizer_set_enable_flag(&(virt_ctxt->offload_virt), true);
virt_ctxt->temp_disabled = false;
if (virt_ctxt->ctl)
offload_virtualizer_send_params(virt_ctxt->ctl,
virt_ctxt->offload_virt,
OFFLOAD_SEND_VIRTUALIZER_ENABLE_FLAG);
}
}
offload_virtualizer_set_device(&(virt_ctxt->offload_virt), device);
@ -213,7 +221,9 @@ int virtualizer_enable(effect_context_t *context)
virtualizer_context_t *virt_ctxt = (virtualizer_context_t *)context;
ALOGV("%s", __func__);
if (!offload_virtualizer_get_enable_flag(&(virt_ctxt->offload_virt))) {
if (!offload_virtualizer_get_enable_flag(&(virt_ctxt->offload_virt)) &&
!(virt_ctxt->temp_disabled)) {
offload_virtualizer_set_enable_flag(&(virt_ctxt->offload_virt), true);
if (virt_ctxt->ctl && virt_ctxt->strength)
offload_virtualizer_send_params(virt_ctxt->ctl,