Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 410cbfb7 authored by wjiang's avatar wjiang Committed by Steve Kondik
Browse files

post_proc: Fix bassboost/virtualizer not disabled on speaker

When output is unintended device, there's no need to query enable_flag
before setting effect to disabled state. There's possiblity that
enable_flag is 0 as initialized value, which hinder effects from being
disabled.

Change-Id: Ib90c0ad0982dc8274129bb1bed7861e11670fbdb
parent db738c05
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -163,11 +163,8 @@ int bassboost_set_device(effect_context_t *context, uint32_t device)
                                                  OFFLOAD_SEND_BASSBOOST_ENABLE_FLAG);
            }
            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);
        }
        ALOGI("%s: ctxt %p, disabled based on device", __func__, bass_ctxt);
    } else {
        if (bass_ctxt->temp_disabled) {
            if (effect_is_active(&bass_ctxt->common)) {
@@ -178,10 +175,6 @@ int bassboost_set_device(effect_context_t *context, uint32_t device)
                                                  OFFLOAD_SEND_BASSBOOST_ENABLE_FLAG);
            }
            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);
+1 −1
Original line number Diff line number Diff line
@@ -230,7 +230,7 @@ int16_t reverb_get_density(reverb_context_t *context)

void reverb_set_density(reverb_context_t *context, int16_t density)
{
    ALOGV("%s: density: %d", __func__, density);
    ALOGV("%s: ctxt %p, density: %d", __func__, context, density);
    context->reverb_settings.density = density;
    offload_reverb_set_density(&(context->offload_reverb), density);
    if (context->ctl)