summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2013-12-20 17:36:01 -0800
committerEric Laurent <elaurent@google.com>2014-01-30 19:37:52 +0000
commit745e9a8283b56c7772ee7d72383a3f2e012e1ef9 (patch)
tree281cab68618b85ac31ccb6c3a436229d9d81a1ce /services/audioflinger
parent1bf0eecd2ec6a3b3e29ad2c91bcefda76abef2fe (diff)
downloadframeworks_av-745e9a8283b56c7772ee7d72383a3f2e012e1ef9.zip
frameworks_av-745e9a8283b56c7772ee7d72383a3f2e012e1ef9.tar.gz
frameworks_av-745e9a8283b56c7772ee7d72383a3f2e012e1ef9.tar.bz2
audioflinger: fix static track end detection
If a static track is not a fast track, prepareTracks_l() must rely on framesReady() to detect end of buffer and remove the track from the active track list. Failing to do so results in the track staying active but not processed by the mixer because in underrun. This leaves the mix buffer content uninitialized and causes the effect process function to accumulate its output onto undefined data. Bug: 12013676. Change-Id: Iad72c921fa18d34811abf7d1073890c093a27725
Diffstat (limited to 'services/audioflinger')
-rw-r--r--services/audioflinger/Threads.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 2f71db7..73429ec 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -3036,15 +3036,8 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTrac
(mMixerStatusIgnoringFastTracks == MIXER_TRACKS_READY)) {
minFrames = desiredFrames;
}
- // It's not safe to call framesReady() for a static buffer track, so assume it's ready
- size_t framesReady;
- if (track->sharedBuffer() == 0) {
- framesReady = track->framesReady();
- } else if (track->isStopped()) {
- framesReady = 0;
- } else {
- framesReady = 1;
- }
+
+ size_t framesReady = track->framesReady();
if ((framesReady >= minFrames) && track->isReady() &&
!track->isPaused() && !track->isTerminated())
{