summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2015-08-14 09:34:50 -0700
committerAndy Hung <hunga@google.com>2015-08-24 19:07:39 +0000
commitcafe86a9cb6625bb1ec6383e16e28e4c9e455f87 (patch)
tree14b334794322ae63ad0e1478bf9ccdc38335a55d /services/audioflinger
parentb3b34074477b9f8713924e18f7a0120965112720 (diff)
downloadframeworks_av-cafe86a9cb6625bb1ec6383e16e28e4c9e455f87.zip
frameworks_av-cafe86a9cb6625bb1ec6383e16e28e4c9e455f87.tar.gz
frameworks_av-cafe86a9cb6625bb1ec6383e16e28e4c9e455f87.tar.bz2
Do not acknowledge flush() on start() for static tracks
Bug: 22938515 Change-Id: I1de653de169a3fbbaa693da6057897ea57772447
Diffstat (limited to 'services/audioflinger')
-rw-r--r--services/audioflinger/Tracks.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index f7da209..d058255 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -712,9 +712,12 @@ status_t AudioFlinger::PlaybackThread::Track::start(AudioSystem::sync_event_t ev
// But in this case we know the mixer thread (whether normal mixer or fast mixer)
// isn't looking at this track yet: we still hold the normal mixer thread lock,
// and for fast tracks the track is not yet in the fast mixer thread's active set.
- ServerProxy::Buffer buffer;
- buffer.mFrameCount = 1;
- (void) mAudioTrackServerProxy->obtainBuffer(&buffer, true /*ackFlush*/);
+ // TODO: remove race condition on stop() followed by start().
+ if (mSharedBuffer == 0) { // only streaming tracks use flush().
+ ServerProxy::Buffer buffer;
+ buffer.mFrameCount = 1;
+ (void) mAudioTrackServerProxy->obtainBuffer(&buffer, true /*ackFlush*/);
+ }
}
} else {
status = BAD_VALUE;