diff options
author | Phil Burk <philburk@google.com> | 2014-12-11 01:59:39 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-12-11 01:59:40 +0000 |
commit | 94a92c69af528edf6ec17d7978a0c3bb6ab51e63 (patch) | |
tree | 409f45229ea21089bdfb2aadd131288383581b07 /services/audioflinger | |
parent | f484952edd94c1b7ee82d7b108edc1ce08671cc4 (diff) | |
parent | 99adee3c3d9cde6819741a38163954808fea270a (diff) | |
download | frameworks_av-94a92c69af528edf6ec17d7978a0c3bb6ab51e63.zip frameworks_av-94a92c69af528edf6ec17d7978a0c3bb6ab51e63.tar.gz frameworks_av-94a92c69af528edf6ec17d7978a0c3bb6ab51e63.tar.bz2 |
Merge "[audio][audioflinger] Consume all frames when a DirectThread is done." into lmp-mr1-dev
Diffstat (limited to 'services/audioflinger')
-rw-r--r-- | services/audioflinger/Threads.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 1c3cf5d..87f636c 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -4009,9 +4009,14 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::DirectOutputThread::prep bool last = l.get() == track; // The first time a track is added we wait - // for all its buffers to be filled before processing it + // for all its buffers to be filled before processing it. + // Allow draining the buffer in case the client + // app does not call stop() and relies on underrun to stop: + // hence the test on (track->mRetryCount > 1). + // If retryCount<=1 then track is about to underrun and be removed. uint32_t minFrames; - if ((track->sharedBuffer() == 0) && !track->isStopping_1() && !track->isPausing()) { + if ((track->sharedBuffer() == 0) && !track->isStopping_1() && !track->isPausing() + && (track->mRetryCount > 1)) { minFrames = mNormalFrameCount; } else { minFrames = 1; |