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
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index f410a6f..540c9a3 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -7992,8 +7992,15 @@
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 @@
goto Error;
}
- if (mSessionId > AUDIO_SESSION_OUTPUT_MIX) {
- mPinned = true;
- }
ALOGV("Constructor success name %s, Interface %p", mDescriptor.name, mEffectInterface);
return;
Error: