Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f357f31 authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "audioflinger: fix offload resume after drain" into klp-dev

parents 92092b39 1b9f9b13
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -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) {
                        // 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;
                        }
                    }