diff options
author | Glenn Kasten <gkasten@google.com> | 2013-10-17 16:23:39 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-17 16:23:39 -0700 |
commit | 9138d32050411c04cc45c25094352cf8b6e01df9 (patch) | |
tree | 47baaae0e9ea8f737c8ce1af5a52e3872432df70 /services | |
parent | 653edc77815c76769b6ac1871add6f47a95d1dc5 (diff) | |
parent | e45796dee9c072cdb13a00b407e68be2cd55e2f2 (diff) | |
download | frameworks_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')
-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 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; |