From 109347d421413303eb1678dd9e2aa9d40acf89d2 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Mon, 2 Jul 2012 12:31:03 -0700 Subject: audioflinger: fix regression in attachAuxEffect(). Commit 717e1286 introduced a regression in PlaybackThread::Track::attachAuxEffect() when called with an effect ID of 0 to detach the auxiliary effect. It is normal in this case that AudioFlinger::getEffectThread_l() returns 0. Bug 6768757. Change-Id: I7430bd1aad2f68da38f7c3e4794e7ad657bfc6be --- services/audioflinger/AudioFlinger.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'services') diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index abe02932..aab99849 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -4696,11 +4696,8 @@ status_t AudioFlinger::PlaybackThread::Track::attachAuxEffect(int EffectId) Mutex::Autolock _l(af->mLock); sp srcThread = af->getEffectThread_l(AUDIO_SESSION_OUTPUT_MIX, EffectId); - if (srcThread == 0) { - return INVALID_OPERATION; - } - if (EffectId != 0 && playbackThread != srcThread.get()) { + if (EffectId != 0 && srcThread != 0 && playbackThread != srcThread.get()) { Mutex::Autolock _dl(playbackThread->mLock); Mutex::Autolock _sl(srcThread->mLock); sp chain = srcThread->getEffectChain_l(AUDIO_SESSION_OUTPUT_MIX); -- cgit v1.2.3