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

Commit ab30516b authored by Andy Hung's avatar Andy Hung
Browse files

EffectModule: Update mConfig initialization

Use aggregate-initialization of mConfig to zero.

Test: instrumented memcmp with static decltype(mConfig) ZERO
Bug: 70674145
Change-Id: Ifdc8780b5da4e0e959f144a1b927ed9bd48edddf
parent d5de8145
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -67,7 +67,10 @@ AudioFlinger::EffectModule::EffectModule(ThreadBase *thread,
    : mPinned(pinned),
      mThread(thread), mChain(chain), mId(id), mSessionId(sessionId),
      mDescriptor(*desc),
      // mConfig cleared in constructor body, set by configure()
      // clear mConfig to ensure consistent initial value of buffer framecount
      // in case buffers are associated by setInBuffer() or setOutBuffer()
      // prior to configure().
      mConfig{{}, {}},
      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
@@ -80,11 +83,6 @@ AudioFlinger::EffectModule::EffectModule(ThreadBase *thread,
    ALOGV("Constructor %p pinned %d", this, pinned);
    int lStatus;

    // clear configuration to ensure consistent initial value of buffer framecount
    // in case buffers are associated by setInBuffer() or setOutBuffer()
    // prior to configure().
    memset(&mConfig, 0, sizeof(mConfig));

    // create effect engine from effect factory
    mStatus = -ENODEV;
    sp<AudioFlinger> audioFlinger = mAudioFlinger.promote();