diff options
author | Eric Laurent <elaurent@google.com> | 2013-11-14 08:47:42 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-11-14 08:47:42 -0800 |
commit | b50fa77b2cc7dadae1b8ebb591d42976879ac43c (patch) | |
tree | 616fdfd21a97feb44772f1ceb60b46470500a44b /services | |
parent | ec89a75e386c61cf4ace3bc5ab80d064562ebf11 (diff) | |
parent | 9f357f319205d52c04a2c8b5cc9d518ddcfdea94 (diff) | |
download | frameworks_av-b50fa77b2cc7dadae1b8ebb591d42976879ac43c.zip frameworks_av-b50fa77b2cc7dadae1b8ebb591d42976879ac43c.tar.gz frameworks_av-b50fa77b2cc7dadae1b8ebb591d42976879ac43c.tar.bz2 |
am 9f357f31: Merge "audioflinger: fix offload resume after drain" into klp-dev
* commit '9f357f319205d52c04a2c8b5cc9d518ddcfdea94':
audioflinger: fix offload resume after drain
Diffstat (limited to 'services')
-rw-r--r-- | services/audioflinger/Threads.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index ba8195e..b8c1632 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -4066,14 +4066,18 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::OffloadThread::prepareTr track->mState = TrackBase::STOPPING_2; // so presentation completes after drain // do not drain if no data was ever sent to HAL (mStandby == true) if (last && !mStandby) { - sleepTime = 0; - standbyTime = systemTime() + standbyDelay; - mixerStatus = MIXER_DRAIN_TRACK; - mDrainSequence += 2; + // do not modify drain sequence if we are already draining. This happens + // when resuming from pause after drain. + if ((mDrainSequence & 1) == 0) { + sleepTime = 0; + standbyTime = systemTime() + standbyDelay; + mixerStatus = MIXER_DRAIN_TRACK; + mDrainSequence += 2; + } if (mHwPaused) { // It is possible to move from PAUSED to STOPPING_1 without // a resume so we must ensure hardware is running - mOutput->stream->resume(mOutput->stream); + doHwResume = true; mHwPaused = false; } } |