Use constructor to initialize instead of memcpy
Also don't check for thread parameter as it's always non-NULL
Change-Id: Id23ded1370556ef3f76f81f5f0c6fa644bcba681
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index f714cab..0730492 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -7940,7 +7940,7 @@
int sessionId)
: mPinned(sessionId > AUDIO_SESSION_OUTPUT_MIX),
mThread(thread), mChain(chain), mId(id), mSessionId(sessionId),
- // mDescriptor is set below
+ mDescriptor(*desc),
// mConfig is set by configure() and not used before then
mEffectInterface(NULL),
mStatus(NO_INIT), mState(IDLE),
@@ -7950,11 +7950,6 @@
{
ALOGV("Constructor %p", this);
int lStatus;
- if (thread == NULL) {
- return;
- }
-
- memcpy(&mDescriptor, desc, sizeof(effect_descriptor_t));
// create effect engine from effect factory
mStatus = EffectCreate(&desc->uuid, sessionId, thread->id(), &mEffectInterface);