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

Commit 453bcb54 authored by Revathi Uddaraju's avatar Revathi Uddaraju Committed by Andy Hung
Browse files

audio: don't apply ramp if track is paused before the first mix

If a track is paused right after start before it gets a chance to mix
the first frame. Don't apply volume ramp if it resumes later.

Test: Basic audio sanity.  Partner CL.
Bug: 123063164
Change-Id: I969ff1b6edce8faf77f2cdc481db9c1e3ef6d3dd
parent ffb2516c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -4784,8 +4784,11 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTrac
                track->mFillingUpStatus = Track::FS_ACTIVE;
                if (track->mState == TrackBase::RESUMING) {
                    track->mState = TrackBase::ACTIVE;
                    // If a new track is paused immediately after start, do not ramp on resume.
                    if (cblk->mServer != 0) {
                        param = AudioMixer::RAMP_VOLUME;
                    }
                }
                mAudioMixer->setParameter(trackId, AudioMixer::RESAMPLE, AudioMixer::RESET, NULL);
                mLeftVolFloat = -1.0;
            // FIXME should not make a decision based on mServer