diff options
author | Glenn Kasten <gkasten@google.com> | 2013-10-17 23:12:05 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-10-17 23:12:05 +0000 |
commit | dedc7b0fa23c21b525dc8abb572bb8161ad66a9b (patch) | |
tree | ecdb21f054e3c3707ff15146b3eb2f5d24200f44 /services/audioflinger/Tracks.cpp | |
parent | 6fa20187e4cf9ace5692979a84741484f19e3f57 (diff) | |
parent | 12022ff8d223ccf4dfae019c81e4a93a3f44985c (diff) | |
download | frameworks_av-dedc7b0fa23c21b525dc8abb572bb8161ad66a9b.zip frameworks_av-dedc7b0fa23c21b525dc8abb572bb8161ad66a9b.tar.gz frameworks_av-dedc7b0fa23c21b525dc8abb572bb8161ad66a9b.tar.bz2 |
Merge "Fix flush() followed by start()" into klp-dev
Diffstat (limited to 'services/audioflinger/Tracks.cpp')
-rw-r--r-- | services/audioflinger/Tracks.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp index 9c6e724..e93833f 100644 --- a/services/audioflinger/Tracks.cpp +++ b/services/audioflinger/Tracks.cpp @@ -600,6 +600,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; |