summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2010-03-31 12:21:17 -0700
committerEric Laurent <elaurent@google.com>2010-03-31 12:36:34 -0700
commit71f37cd8a175ee00635cb91506d6810fd02b5b51 (patch)
tree644a6fc98cfff87246a11cf8d1531c9c528a6a09 /libs
parent804878f3a3ea40ace5bd572cee98f9e13a0dbf0b (diff)
downloadframeworks_base-71f37cd8a175ee00635cb91506d6810fd02b5b51.zip
frameworks_base-71f37cd8a175ee00635cb91506d6810fd02b5b51.tar.gz
frameworks_base-71f37cd8a175ee00635cb91506d6810fd02b5b51.tar.bz2
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
Diffstat (limited to 'libs')
-rw-r--r--libs/audioflinger/AudioFlinger.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/audioflinger/AudioFlinger.cpp b/libs/audioflinger/AudioFlinger.cpp
index 815a367..7166c89 100644
--- a/libs/audioflinger/AudioFlinger.cpp
+++ b/libs/audioflinger/AudioFlinger.cpp
@@ -1488,7 +1488,7 @@ uint32_t AudioFlinger::MixerThread::prepareTracks_l(const SortedVector< wp<Track
// for all its buffers to be filled before processing it
mAudioMixer->setActiveTrack(track->name());
if (cblk->framesReady() && (track->isReady() || track->isStopped()) &&
- !track->isPaused())
+ !track->isPaused() && !track->isTerminated())
{
//LOGV("track %d u=%08x, s=%08x [OK] on thread %p", track->name(), cblk->user, cblk->server, this);