summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-02-03 07:18:06 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-02-03 07:18:06 -0800
commit62da7fbd60bee2dd57f503126266e9f04311d400 (patch)
tree22c9118701f42b77ed573001779390437d96872c /services
parentd45ee9d9d61af0791c7c3c51f8d4fe6794ef02a5 (diff)
parent83d86538c4c479a9225c75ab27938e8f05abb9c8 (diff)
downloadframeworks_av-62da7fbd60bee2dd57f503126266e9f04311d400.zip
frameworks_av-62da7fbd60bee2dd57f503126266e9f04311d400.tar.gz
frameworks_av-62da7fbd60bee2dd57f503126266e9f04311d400.tar.bz2
Merge "Make AudioTrack control block volume field private"
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/AudioFlinger.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 0c44f3f..bc2fdd6 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -2193,7 +2193,7 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTrac
// read original volumes with volume control
float typeVolume = mStreamTypes[track->type()].volume;
float v = masterVolume * typeVolume;
- uint32_t vlr = cblk->volumeLR;
+ uint32_t vlr = cblk->getVolumeLR();
vl = vlr & 0xFFFF;
vr = vlr >> 16;
// track volumes come from shared memory, so can't be trusted and must be clamped
@@ -2731,7 +2731,7 @@ bool AudioFlinger::DirectOutputThread::threadLoop()
} else {
float typeVolume = mStreamTypes[track->type()].volume;
float v = mMasterVolume * typeVolume;
- uint32_t vlr = cblk->volumeLR;
+ uint32_t vlr = cblk->getVolumeLR();
float v_clamped = v * (vlr & 0xFFFF);
if (v_clamped > MAX_GAIN) v_clamped = MAX_GAIN;
left = v_clamped/MAX_GAIN;
@@ -3470,7 +3470,7 @@ void AudioFlinger::PlaybackThread::Track::destroy()
void AudioFlinger::PlaybackThread::Track::dump(char* buffer, size_t size)
{
- uint32_t vlr = mCblk->volumeLR;
+ uint32_t vlr = mCblk->getVolumeLR();
snprintf(buffer, size, " %05d %05d %03u %03u 0x%08x %05u %04u %1d %1d %1d %05u %05u %05u 0x%08x 0x%08x 0x%08x 0x%08x\n",
mName - AudioMixer::TRACK0,
(mClient == NULL) ? getpid() : mClient->pid(),
@@ -3829,7 +3829,6 @@ AudioFlinger::PlaybackThread::OutputTrack::OutputTrack(
if (mCblk != NULL) {
mCblk->flags |= CBLK_DIRECTION_OUT;
mCblk->buffers = (char*)mCblk + sizeof(audio_track_cblk_t);
- mCblk->volumeLR = (MAX_GAIN_INT << 16) | MAX_GAIN_INT;
mOutBuffer.frameCount = 0;
playbackThread->mTracks.add(this);
ALOGV("OutputTrack constructor mCblk %p, mBuffer %p, mCblk->buffers %p, " \