summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2015-09-08 23:16:32 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-09-08 23:16:32 +0000
commite4be7999d8cc689260ee54514cee0da67d9cf7e3 (patch)
tree9c80ae220446990987e146e68553ace5c7b8cb55 /services
parent0cf901dd983e1a6b37eba2ab4414d647494588f1 (diff)
parentcafe86a9cb6625bb1ec6383e16e28e4c9e455f87 (diff)
downloadframeworks_av-e4be7999d8cc689260ee54514cee0da67d9cf7e3.zip
frameworks_av-e4be7999d8cc689260ee54514cee0da67d9cf7e3.tar.gz
frameworks_av-e4be7999d8cc689260ee54514cee0da67d9cf7e3.tar.bz2
Merge "Do not acknowledge flush() on start() for static tracks" into mnc-dr-dev
Diffstat (limited to 'services')
-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;