diff options
author | Glenn Kasten <gkasten@google.com> | 2012-01-17 12:20:54 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2012-01-17 16:25:17 -0800 |
commit | 0632bad8bad41bc44184596478ec2d203d52096f (patch) | |
tree | 43aa40695d8efeeeef9b90c2fc90baff395a1ada /media | |
parent | 73d27c3d46ce9a19c0cc358d0b2788f1f51706d7 (diff) | |
download | frameworks_base-0632bad8bad41bc44184596478ec2d203d52096f.zip frameworks_base-0632bad8bad41bc44184596478ec2d203d52096f.tar.gz frameworks_base-0632bad8bad41bc44184596478ec2d203d52096f.tar.bz2 |
Track volume cleanup
Always read and write track volumes atomically. In most places this was
already being done, but there were a couple places where the left and
right channels were read independently.
Changed constant MAX_GAIN_INT to be a uint32_t instead of a float.
It is always used as a uint32_t in comparisons and assignments.
Use MAX_GAIN_INT in more places.
Now that volume is always accessed atomically, removed the union
and alias for uint16_t volume[2], and kept only volumeLR.
Removed volatile as it's meaningless.
In AudioFlinger, clamp the track volumes read from shared memory
before applying master and stream volume.
Change-Id: If65e2b27e5bc3db5bf75540479843041b58433f0
Diffstat (limited to 'media')
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 97b2312..7e338de 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -480,7 +480,6 @@ status_t AudioTrack::setVolume(float left, float right) mVolume[LEFT] = left; mVolume[RIGHT] = right; - // write must be atomic mCblk->volumeLR = (uint32_t(uint16_t(right * 0x1000)) << 16) | uint16_t(left * 0x1000); return NO_ERROR; |