diff options
author | Glenn Kasten <gkasten@google.com> | 2011-12-14 17:35:36 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-12-14 17:35:36 -0800 |
commit | 42968939dfce0954d6540011199045ec4ed7de80 (patch) | |
tree | 0e297b59294db0688bab53cad567bb235f3ec4df /services/audioflinger/AudioMixer.cpp | |
parent | a06a9a50b37d60e9c43c9de9f8ea3a8649cd5691 (diff) | |
parent | c5ac4cb3a5124860ccfc7e4ff66251c55a5595ca (diff) | |
download | frameworks_av-42968939dfce0954d6540011199045ec4ed7de80.zip frameworks_av-42968939dfce0954d6540011199045ec4ed7de80.tar.gz frameworks_av-42968939dfce0954d6540011199045ec4ed7de80.tar.bz2 |
Merge "Fix indentation and whitespace"
Diffstat (limited to 'services/audioflinger/AudioMixer.cpp')
-rw-r--r-- | services/audioflinger/AudioMixer.cpp | 95 |
1 files changed, 47 insertions, 48 deletions
diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp index 63d9a88..847f8dc 100644 --- a/services/audioflinger/AudioMixer.cpp +++ b/services/audioflinger/AudioMixer.cpp @@ -84,19 +84,19 @@ AudioMixer::AudioMixer(size_t frameCount, uint32_t sampleRate) } } - AudioMixer::~AudioMixer() - { - track_t* t = mState.tracks; - for (int i=0 ; i<32 ; i++) { - delete t->resampler; - t++; - } - delete [] mState.outputTemp; - delete [] mState.resampleTemp; - } +AudioMixer::~AudioMixer() +{ + track_t* t = mState.tracks; + for (int i=0 ; i<32 ; i++) { + delete t->resampler; + t++; + } + delete [] mState.outputTemp; + delete [] mState.resampleTemp; +} - int AudioMixer::getTrackName() - { +int AudioMixer::getTrackName() +{ uint32_t names = mTrackNames; uint32_t mask = 1; int n = 0; @@ -110,18 +110,18 @@ AudioMixer::AudioMixer(size_t frameCount, uint32_t sampleRate) return TRACK0 + n; } return -1; - } +} - void AudioMixer::invalidateState(uint32_t mask) - { +void AudioMixer::invalidateState(uint32_t mask) +{ if (mask) { mState.needsChanged |= mask; mState.hook = process__validate; } } - void AudioMixer::deleteTrackName(int name) - { +void AudioMixer::deleteTrackName(int name) +{ name -= TRACK0; if (uint32_t(name) < MAX_NUM_TRACKS) { ALOGV("deleteTrackName(%d)", name); @@ -141,7 +141,7 @@ AudioMixer::AudioMixer(size_t frameCount, uint32_t sampleRate) track.volumeInc[1] = 0; mTrackNames &= ~(1<<name); } - } +} status_t AudioMixer::enable(int name) { @@ -456,33 +456,33 @@ void AudioMixer::process__validate(state_t* state) countActiveTracks, state->enabledTracks, all16BitsStereoNoResample, resampling, volumeRamp); - state->hook(state); - - // Now that the volume ramp has been done, set optimal state and - // track hooks for subsequent mixer process - if (countActiveTracks) { - int allMuted = 1; - uint32_t en = state->enabledTracks; - while (en) { - const int i = 31 - __builtin_clz(en); - en &= ~(1<<i); - track_t& t = state->tracks[i]; - if (!t.doesResample() && t.volumeRL == 0) - { - t.needs |= NEEDS_MUTE_ENABLED; - t.hook = track__nop; - } else { - allMuted = 0; - } - } - if (allMuted) { - state->hook = process__nop; - } else if (all16BitsStereoNoResample) { - if (countActiveTracks == 1) { - state->hook = process__OneTrack16BitsStereoNoResampling; - } - } - } + state->hook(state); + + // Now that the volume ramp has been done, set optimal state and + // track hooks for subsequent mixer process + if (countActiveTracks) { + int allMuted = 1; + uint32_t en = state->enabledTracks; + while (en) { + const int i = 31 - __builtin_clz(en); + en &= ~(1<<i); + track_t& t = state->tracks[i]; + if (!t.doesResample() && t.volumeRL == 0) + { + t.needs |= NEEDS_MUTE_ENABLED; + t.hook = track__nop; + } else { + allMuted = 0; + } + } + if (allMuted) { + state->hook = process__nop; + } else if (all16BitsStereoNoResample) { + if (countActiveTracks == 1) { + state->hook = process__OneTrack16BitsStereoNoResampling; + } + } + } } static inline @@ -999,7 +999,7 @@ void AudioMixer::process__genericNoResampling(state_t* state) } - // generic code with resampling +// generic code with resampling void AudioMixer::process__genericResampling(state_t* state) { int32_t* const outTemp = state->outputTemp; @@ -1179,7 +1179,7 @@ void AudioMixer::process__TwoTracks16BitsStereoNoResampling(state_t* state) } in1 = buff; b1.frameCount = numFrames; - } else { + } else { in1 = b1.i16; } frameCount1 = b1.frameCount; @@ -1221,4 +1221,3 @@ void AudioMixer::process__TwoTracks16BitsStereoNoResampling(state_t* state) // ---------------------------------------------------------------------------- }; // namespace android - |