diff options
author | Eric Laurent <elaurent@google.com> | 2013-11-14 08:49:39 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-11-14 08:49:39 -0800 |
commit | b04b25321dd323142eec7c5136c81dea3629cf14 (patch) | |
tree | 99596e465d2fd7d2083613360762c3baac1b25e5 /services | |
parent | 4f3f5e01208a547e8ea6ff6442a5a33e10748162 (diff) | |
parent | b50fa77b2cc7dadae1b8ebb591d42976879ac43c (diff) | |
download | frameworks_av-b04b25321dd323142eec7c5136c81dea3629cf14.zip frameworks_av-b04b25321dd323142eec7c5136c81dea3629cf14.tar.gz frameworks_av-b04b25321dd323142eec7c5136c81dea3629cf14.tar.bz2 |
am b50fa77b: am 9f357f31: Merge "audioflinger: fix offload resume after drain" into klp-dev
* commit 'b50fa77b2cc7dadae1b8ebb591d42976879ac43c':
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 6987dbd..b893625 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -4076,14 +4076,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; } } |