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

Commit b6be7f22 authored by Bryant Liu's avatar Bryant Liu Committed by Glenn Kasten
Browse files

frameworks: av: fix bug in the volume management



which can cause volume levels to be applied twice. After applying volume
in the effect chain, the remaining volume needs to be converted back to
floating point before providing to mAudioMixer.

Bug: 15583440
Change-Id: I3c884f95b0fa9ad1b554285b069601c850c54776
Signed-off-by: default avatarGlenn Kasten <gkasten@google.com>
parent 7903bb2b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3428,6 +3428,9 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTrac
            if (chain != 0 && chain->setVolume_l(&vl, &vr)) {
                // Do not ramp volume if volume is controlled by effect
                param = AudioMixer::VOLUME;
                // Update remaining floating point volume levels
                vlf = (float)vl / (1 << 24);
                vrf = (float)vr / (1 << 24);
                track->mHasVolumeController = true;
            } else {
                // force no volume ramp when volume controller was just disabled or removed