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 | b1cf75c4935001f61057989ee3cf27bbf09ecd9c (patch) | |
tree | e3daaea6160475e36dedfccaabf5d8b94406d05e /media/libmedia/AudioTrack.cpp | |
parent | f237a30e9344d43f832ba11db6f62c6ad2084444 (diff) | |
download | frameworks_av-b1cf75c4935001f61057989ee3cf27bbf09ecd9c.zip frameworks_av-b1cf75c4935001f61057989ee3cf27bbf09ecd9c.tar.gz frameworks_av-b1cf75c4935001f61057989ee3cf27bbf09ecd9c.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/libmedia/AudioTrack.cpp')
-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; |