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

Commit 95b1e7fc authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 4331a8f7 50a3feee
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -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,
+11 −1
Original line number Diff line number Diff line
@@ -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,