OSDN Git Service

Fix isssue 2548710: Native AudioTrack resources never freed.
authorEric Laurent <elaurent@google.com>
Wed, 31 Mar 2010 19:21:17 +0000 (12:21 -0700)
committerEric Laurent <elaurent@google.com>
Wed, 31 Mar 2010 19:36:34 +0000 (12:36 -0700)
commitdeea502a920d3739efae5a29c6fbf56780d68501
tree3e97de9342e02549a42f7de706763a5431ebe916
parent54de5d19bcdf0addf19fe55599bb5b3835e85690
Fix isssue 2548710: Native AudioTrack resources never freed.

The problem is a bug in AudioFlinger::MixerThread::prepareTracks_l() that makes that even if the TrackHandle
is destroyed, the corresponding Track will remain active as long as frames are ready for mixing.
If the track uses shared memory (static mode) and the sound is looped, this track will play for ever.

The fix consists in removing the track from active list immediately if the track is terminated.

Change-Id: I4582aa1d981079ab79be442fb6185f5afaed5cf3
libs/audioflinger/AudioFlinger.cpp