diff options
author | Bryant Liu <bryant_liu@htc.com> | 2014-06-12 22:02:41 +0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2014-06-12 09:17:38 -0700 |
commit | b6be7f22a82ee3bad8bcc709d21e72fc4727da09 (patch) | |
tree | 9a80f902d9854437102b313aae6483e8321a2ee6 /services | |
parent | 7903bb2b3065d58cc75637900922b434f50024d9 (diff) | |
download | frameworks_av-b6be7f22a82ee3bad8bcc709d21e72fc4727da09.zip frameworks_av-b6be7f22a82ee3bad8bcc709d21e72fc4727da09.tar.gz frameworks_av-b6be7f22a82ee3bad8bcc709d21e72fc4727da09.tar.bz2 |
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: Glenn Kasten <gkasten@google.com>
Diffstat (limited to 'services')
-rwxr-xr-x[-rw-r--r--] | services/audioflinger/Threads.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index d08c966..c0daa08 100644..100755 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -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 |