summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Tracks.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-10-17 16:23:39 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-17 16:23:39 -0700
commit9138d32050411c04cc45c25094352cf8b6e01df9 (patch)
tree47baaae0e9ea8f737c8ce1af5a52e3872432df70 /services/audioflinger/Tracks.cpp
parent653edc77815c76769b6ac1871add6f47a95d1dc5 (diff)
parente45796dee9c072cdb13a00b407e68be2cd55e2f2 (diff)
downloadframeworks_av-9138d32050411c04cc45c25094352cf8b6e01df9.zip
frameworks_av-9138d32050411c04cc45c25094352cf8b6e01df9.tar.gz
frameworks_av-9138d32050411c04cc45c25094352cf8b6e01df9.tar.bz2
am e45796de: am dedc7b0f: Merge "Fix flush() followed by start()" into klp-dev
* commit 'e45796dee9c072cdb13a00b407e68be2cd55e2f2': Fix flush() followed by start()
Diffstat (limited to 'services/audioflinger/Tracks.cpp')
-rw-r--r--services/audioflinger/Tracks.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index 3970acd..88ae288 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -609,6 +609,15 @@ status_t AudioFlinger::PlaybackThread::Track::start(AudioSystem::sync_event_t ev
// track was already in the active list, not a problem
if (status == ALREADY_EXISTS) {
status = NO_ERROR;
+ } else {
+ // Acknowledge any pending flush(), so that subsequent new data isn't discarded.
+ // It is usually unsafe to access the server proxy from a binder thread.
+ // 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);
}
} else {
status = BAD_VALUE;