From 4c5ed30aeb86b2b1aeaf7809d569e46bc75d330c Mon Sep 17 00:00:00 2001 From: Andy Hung Date: Wed, 9 May 2018 11:16:21 -0700 Subject: [PATCH] AudioTrack: Allow flush in flush state to clear subsequent written data Fixes Photos a/v sync issue introduced by commit 1d3556d6a068f141ac390a04f6a9d92a70f8d7ed Test: Photos, pause, then seek several times, then play. Test: CTS AudioTrackTest, Bluetooth, Offload, Gallery, Play Music. Bug: 79327282 Change-Id: I9de8edd88b526b5a9dbc9cd720bf725474949dfc --- media/libaudioclient/AudioTrack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/libaudioclient/AudioTrack.cpp b/media/libaudioclient/AudioTrack.cpp index 86791c2e6e..ab9efe8893 100644 --- a/media/libaudioclient/AudioTrack.cpp +++ b/media/libaudioclient/AudioTrack.cpp @@ -806,7 +806,7 @@ void AudioTrack::flush() return; } AutoMutex lock(mLock); - if (mState == STATE_ACTIVE || mState == STATE_FLUSHED) { + if (mState == STATE_ACTIVE) { return; } flush_l();