diff options
author | Glenn Kasten <gkasten@google.com> | 2012-01-26 10:53:32 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2012-02-17 09:39:07 -0800 |
commit | a111792f1314479c649d1d44c30c2caf70c00c2a (patch) | |
tree | f67b5f32a61a259f292b7d0d992f31b8e2ff857c /services/audioflinger/AudioMixer.cpp | |
parent | 761defc341c5ce9019a42919c441f035f665ec0d (diff) | |
download | frameworks_av-a111792f1314479c649d1d44c30c2caf70c00c2a.zip frameworks_av-a111792f1314479c649d1d44c30c2caf70c00c2a.tar.gz frameworks_av-a111792f1314479c649d1d44c30c2caf70c00c2a.tar.bz2 |
Simplify code
Use DefaultKeyedVector::valueFor to avoid extra test
Make local variables as local as possible
No double parentheses
No typedef for single use
No parentheses around indirect function call
No AudioFlinger:: prefix when not needed
Remove unnecessary casts
Remove block with only one line
Saves 128 bytes
Change-Id: I3a87430eeb01b81e7b81a1c38f6fdd3274ec48f3
Diffstat (limited to 'services/audioflinger/AudioMixer.cpp')
-rw-r--r-- | services/audioflinger/AudioMixer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp index c399691..f3bf953 100644 --- a/services/audioflinger/AudioMixer.cpp +++ b/services/audioflinger/AudioMixer.cpp @@ -556,7 +556,7 @@ void AudioMixer::volumeRampStereo(track_t* t, int32_t* out, size_t frameCount, i } t->prevVolume[0] = vl; t->prevVolume[1] = vr; - t->adjustVolumeRamp((aux != NULL)); + t->adjustVolumeRamp(aux != NULL); } void AudioMixer::volumeStereo(track_t* t, int32_t* out, size_t frameCount, int32_t* temp, int32_t* aux) @@ -862,7 +862,7 @@ void AudioMixer::process__genericNoResampling(state_t* state, int64_t pts) while (outFrames) { size_t inFrames = (t.frameCount > outFrames)?outFrames:t.frameCount; if (inFrames) { - (t.hook)(&t, outTemp + (BLOCKSIZE-outFrames)*MAX_NUM_CHANNELS, inFrames, state->resampleTemp, aux); + t.hook(&t, outTemp + (BLOCKSIZE-outFrames)*MAX_NUM_CHANNELS, inFrames, state->resampleTemp, aux); t.frameCount -= inFrames; outFrames -= inFrames; if (CC_UNLIKELY(aux != NULL)) { @@ -944,7 +944,7 @@ void AudioMixer::process__genericResampling(state_t* state, int64_t pts) // the resampler. if ((t.needs & NEEDS_RESAMPLE__MASK) == NEEDS_RESAMPLE_ENABLED) { t.resampler->setPTS(pts); - (t.hook)(&t, outTemp, numFrames, state->resampleTemp, aux); + t.hook(&t, outTemp, numFrames, state->resampleTemp, aux); } else { size_t outFrames = 0; @@ -961,7 +961,7 @@ void AudioMixer::process__genericResampling(state_t* state, int64_t pts) if (CC_UNLIKELY(aux != NULL)) { aux += outFrames; } - (t.hook)(&t, outTemp + outFrames*MAX_NUM_CHANNELS, t.buffer.frameCount, state->resampleTemp, aux); + t.hook(&t, outTemp + outFrames*MAX_NUM_CHANNELS, t.buffer.frameCount, state->resampleTemp, aux); outFrames += t.buffer.frameCount; t.bufferProvider->releaseBuffer(&t.buffer); } |