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

Commit 6507d9bb authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "AudioFlinger: fix createEffect() for second client attached"

parents f8dd1dca 4f1d4e92
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -128,6 +128,9 @@ status_t AudioEffect::set(const effect_uuid_t *type,
    mStatus = audioFlinger->createEffect(request, &response);

    if (mStatus == OK) {
        if (response.alreadyExists) {
            mStatus = ALREADY_EXISTS;
        }
        mId = response.id;
        enabled = response.enabled;
        iEffect = response.effect;
+1 −0
Original line number Diff line number Diff line
@@ -29,4 +29,5 @@ parcelable CreateEffectResponse {
    boolean enabled;
    @nullable IEffect effect;
    EffectDescriptor desc;
    boolean alreadyExists;
}
+6 −0
Original line number Diff line number Diff line
@@ -3990,6 +3990,12 @@ status_t AudioFlinger::createEffect(const media::CreateEffectRequest& request,

Register:
    if (!probe && (lStatus == NO_ERROR || lStatus == ALREADY_EXISTS)) {
        if (lStatus == ALREADY_EXISTS) {
            response->alreadyExists = true;
            lStatus = NO_ERROR;
        } else {
            response->alreadyExists = false;
        }
        // Check CPU and memory usage
        sp<EffectBase> effect = handle->effect().promote();
        if (effect != nullptr) {