summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti S. Lankila <alankila@gmail.com>2010-08-21 05:47:23 +0300
committerAntti S. Lankila <alankila@gmail.com>2010-08-22 14:18:27 +0300
commit81e1cd46ad02a6c2c0be28c0af66c27d1c41e391 (patch)
tree186a42c05ba43fae3cc5481a4245e4d5fcd8dd3b
parente716ae55d730cfecfb3612fded68057cc1fcdc7e (diff)
downloadframeworks_base-81e1cd46ad02a6c2c0be28c0af66c27d1c41e391.zip
frameworks_base-81e1cd46ad02a6c2c0be28c0af66c27d1c41e391.tar.gz
frameworks_base-81e1cd46ad02a6c2c0be28c0af66c27d1c41e391.tar.bz2
Initialize track volume more correctly
prevVolume is scaled by 16 because of the ramping performed with it.
-rw-r--r--libs/audioflinger/AudioMixer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/audioflinger/AudioMixer.cpp b/libs/audioflinger/AudioMixer.cpp
index 1853c61..1add9f4 100644
--- a/libs/audioflinger/AudioMixer.cpp
+++ b/libs/audioflinger/AudioMixer.cpp
@@ -59,10 +59,10 @@ AudioMixer::AudioMixer(size_t frameCount, uint32_t sampleRate, AudioDSP& dsp)
track_t* t = mState.tracks;
for (int i=0 ; i<32 ; i++) {
t->needs = 0;
- t->prevVolume[0] = UNITY_GAIN;
- t->prevVolume[1] = UNITY_GAIN;
t->volume[0] = UNITY_GAIN;
t->volume[1] = UNITY_GAIN;
+ t->prevVolume[0] = UNITY_GAIN << 16;
+ t->prevVolume[1] = UNITY_GAIN << 16;
t->volumeInc[0] = 0;
t->volumeInc[1] = 0;
t->channelCount = 2;