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

Commit d4d91578 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "audioflinger: Remove effect from hal before closing." am: c961cd4d...

Merge "audioflinger: Remove effect from hal before closing." am: c961cd4d am: 7e5965b8 am: 52148b83 am: 0cc7be88

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1403449

Change-Id: I45a7ea255673bd55097e257d9b4cc4a4ee78326d
parents f4603403 0cc7be88
Loading
Loading
Loading
Loading
+3 −14
Original line number Diff line number Diff line
@@ -292,6 +292,9 @@ ssize_t AudioFlinger::EffectBase::removeHandle_l(EffectHandle *handle)
        }
    }

    // Prevent calls to process() and other functions on effect interface from now on.
    // The effect engine will be released by the destructor when the last strong reference on
    // this object is released which can happen after next process is called.
    if (mHandles.size() == 0 && !mPinned) {
        mState = DESTROYED;
    }
@@ -565,20 +568,6 @@ AudioFlinger::EffectModule::~EffectModule()

}

ssize_t AudioFlinger::EffectModule::removeHandle_l(EffectHandle *handle)
{
    ssize_t status = EffectBase::removeHandle_l(handle);

    // Prevent calls to process() and other functions on effect interface from now on.
    // The effect engine will be released by the destructor when the last strong reference on
    // this object is released which can happen after next process is called.
    if (status == 0 && !mPinned) {
        mEffectInterface->close();
    }

    return status;
}

bool AudioFlinger::EffectModule::updateState() {
    Mutex::Autolock _l(mLock);

+1 −3
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ public:
    status_t addHandle(EffectHandle *handle);
    ssize_t disconnectHandle(EffectHandle *handle, bool unpinIfLast);
    ssize_t removeHandle(EffectHandle *handle);
    virtual ssize_t removeHandle_l(EffectHandle *handle);
    ssize_t removeHandle_l(EffectHandle *handle);
    EffectHandle* controlHandle_l();
    bool purgeHandles();

@@ -240,8 +240,6 @@ public:
        return mOutBuffer != 0 ? reinterpret_cast<int16_t*>(mOutBuffer->ptr()) : NULL;
    }

    ssize_t removeHandle_l(EffectHandle *handle) override;

    status_t         setDevices(const AudioDeviceTypeAddrVector &devices);
    status_t         setInputDevice(const AudioDeviceTypeAddr &device);
    status_t         setVolume(uint32_t *left, uint32_t *right, bool controller);