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

Commit 415fa759 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Fix uninitialized field EffectModule::mPinned

Also mark EffectModule::mId and EffectModule::mSessionId const, and
document the initialization of other fields in EffectModule.

Change-Id: Ic1ca008e75e9b5924743ffc35bef80057f3a0669
parent d5903ec1
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -7992,8 +7992,15 @@ AudioFlinger::EffectModule::EffectModule(ThreadBase *thread,
                                        effect_descriptor_t *desc,
                                        int id,
                                        int sessionId)
    : mThread(thread), mChain(chain), mId(id), mSessionId(sessionId), mEffectInterface(NULL),
      mStatus(NO_INIT), mState(IDLE), mSuspended(false)
    : mPinned(sessionId > AUDIO_SESSION_OUTPUT_MIX),
      mThread(thread), mChain(chain), mId(id), mSessionId(sessionId),
      // mDescriptor is set below
      // mConfig is set by configure() and not used before then
      mEffectInterface(NULL),
      mStatus(NO_INIT), mState(IDLE),
      // mMaxDisableWaitCnt is set by configure() and not used before then
      // mDisableWaitCnt is set by process() and updateState() and not used before then
      mSuspended(false)
{
    ALOGV("Constructor %p", this);
    int lStatus;
@@ -8015,9 +8022,6 @@ AudioFlinger::EffectModule::EffectModule(ThreadBase *thread,
        goto Error;
    }

    if (mSessionId > AUDIO_SESSION_OUTPUT_MIX) {
        mPinned = true;
    }
    ALOGV("Constructor success name %s, Interface %p", mDescriptor.name, mEffectInterface);
    return;
Error:
+2 −2
Original line number Diff line number Diff line
@@ -1560,8 +1560,8 @@ private:
mutable Mutex               mLock;      // mutex for process, commands and handles list protection
        wp<ThreadBase>      mThread;    // parent thread
        wp<EffectChain>     mChain;     // parent effect chain
        int                 mId;        // this instance unique ID
        int                 mSessionId; // audio session ID
        const int           mId;        // this instance unique ID
        const int           mSessionId; // audio session ID
        effect_descriptor_t mDescriptor;// effect descriptor received from effect engine
        effect_config_t     mConfig;    // input and output audio configuration
        effect_handle_t  mEffectInterface; // Effect module C API