From aaa44478a373232d8416657035a9020f9c7aa7c3 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Fri, 12 Sep 2014 17:41:50 -0700 Subject: audioflinger: fix pre processing effect leak When a capture thread was closed, the effects attached to this thread were left dangling and the associated effect chain destroyed. When their last client was disconnected, the effects were not released properly from the effect library because the destruction process could not be completed without the effect being attached to a thread. A similar problem prevented a RecordTrack to be properly released if its client was destroyed after the capture thread. The fix consists in allowing the effect or record track to be properly released even if its parent thread cannot be promoted. Also save any effect chain still present on a closed capture thread in case a new client wants to reuse the effects on the same session later. Bug: 17110064. Change-Id: I5cd644daa357afd1f3548f9bcb28e6152d95fdb8 --- services/audioflinger/Effects.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'services/audioflinger/Effects.h') diff --git a/services/audioflinger/Effects.h b/services/audioflinger/Effects.h index 4170fd4..eaf90e7 100644 --- a/services/audioflinger/Effects.h +++ b/services/audioflinger/Effects.h @@ -153,6 +153,7 @@ mutable Mutex mLock; // mutex for process, commands and handl uint32_t mDisableWaitCnt; // current process() calls count during disable period. bool mSuspended; // effect is suspended: temporarily disabled by framework bool mOffloaded; // effect is currently offloaded to the audio DSP + wp mAudioFlinger; }; // The EffectHandle class implements the IEffect interface. It provides resources @@ -347,6 +348,8 @@ protected: void clearInputBuffer_l(sp thread); + void setThread(const sp& thread); + wp mThread; // parent mixer thread Mutex mLock; // mutex protecting effect list Vector< sp > mEffects; // list of effect modules -- cgit v1.1