OSDN Git Service

Track volume cleanup
authorGlenn Kasten <gkasten@google.com>
Tue, 17 Jan 2012 20:20:54 +0000 (12:20 -0800)
committerGlenn Kasten <gkasten@google.com>
Wed, 18 Jan 2012 00:25:17 +0000 (16:25 -0800)
commit0632bad8bad41bc44184596478ec2d203d52096f
tree43aa40695d8efeeeef9b90c2fc90baff395a1ada
parent73d27c3d46ce9a19c0cc358d0b2788f1f51706d7
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
include/private/media/AudioTrackShared.h
media/libmedia/AudioTrack.cpp
services/audioflinger/AudioFlinger.cpp