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

Commit 5b3f02ea authored by Eric Laurent's avatar Eric Laurent Committed by Automerger Merge Worker
Browse files

audioflinger: fix input effect transfer am: 9f57aa81

parents aab4f4bd 9f57aa81
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -570,7 +570,6 @@ AudioFlinger::EffectModule::EffectModule(const sp<AudioFlinger::EffectCallbackIn
      mMaxDisableWaitCnt(1), // set by configure(), should be >= 1
      mDisableWaitCnt(0),    // set by process() and updateState()
      mOffloaded(false),
      mAddedToHal(false),
      mIsOutput(false)
#ifdef FLOAT_EFFECT_CHAIN
      , mSupportsFloat(false)
@@ -1104,12 +1103,12 @@ void AudioFlinger::EffectModule::addEffectToHal_l()
{
    if ((mDescriptor.flags & EFFECT_FLAG_TYPE_MASK) == EFFECT_FLAG_TYPE_PRE_PROC ||
         (mDescriptor.flags & EFFECT_FLAG_TYPE_MASK) == EFFECT_FLAG_TYPE_POST_PROC) {
        if (mAddedToHal) {
        if (mCurrentHalStream == getCallback()->io()) {
            return;
        }

        (void)getCallback()->addEffectToHal(mEffectInterface);
        mAddedToHal = true;
        mCurrentHalStream = getCallback()->io();
    }
}

@@ -1205,12 +1204,11 @@ status_t AudioFlinger::EffectModule::removeEffectFromHal_l()
{
    if ((mDescriptor.flags & EFFECT_FLAG_TYPE_MASK) == EFFECT_FLAG_TYPE_PRE_PROC ||
             (mDescriptor.flags & EFFECT_FLAG_TYPE_MASK) == EFFECT_FLAG_TYPE_POST_PROC) {
        if (!mAddedToHal) {
            return NO_ERROR;
        if (mCurrentHalStream != getCallback()->io()) {
            return (mCurrentHalStream == AUDIO_IO_HANDLE_NONE) ? NO_ERROR : INVALID_OPERATION;
        }

        getCallback()->removeEffectFromHal(mEffectInterface);
        mAddedToHal = false;
        mCurrentHalStream = AUDIO_IO_HANDLE_NONE;
    }
    return NO_ERROR;
}
+2 −1
Original line number Diff line number Diff line
@@ -319,7 +319,8 @@ private:
                                    // sending disable command.
    uint32_t mDisableWaitCnt;       // current process() calls count during disable period.
    bool     mOffloaded;            // effect is currently offloaded to the audio DSP
    bool     mAddedToHal;           // effect has been added to the audio HAL
    // effect has been added to this HAL input stream
    audio_io_handle_t mCurrentHalStream = AUDIO_IO_HANDLE_NONE;
    bool     mIsOutput;             // direction of the AF thread

#ifdef FLOAT_EFFECT_CHAIN