diff options
author | Glenn Kasten <gkasten@google.com> | 2011-12-16 07:30:14 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-12-16 07:30:14 -0800 |
commit | 6d4bf6eda04888144ec59cba4816a2cbb79b9e5c (patch) | |
tree | 213424db0d71f1de94ea2789d272595287664bf6 /services/audioflinger/AudioMixer.cpp | |
parent | b87c068727a15a3d3f0bfdcb758c76a097f5e869 (diff) | |
parent | fba380a0b2c62684ce4272a05165965bae29d6a1 (diff) | |
download | frameworks_av-6d4bf6eda04888144ec59cba4816a2cbb79b9e5c.zip frameworks_av-6d4bf6eda04888144ec59cba4816a2cbb79b9e5c.tar.gz frameworks_av-6d4bf6eda04888144ec59cba4816a2cbb79b9e5c.tar.bz2 |
Merge "setActiveTrack and setBufferProvider can't fail"
Diffstat (limited to 'services/audioflinger/AudioMixer.cpp')
-rw-r--r-- | services/audioflinger/AudioMixer.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp index f302b2f..1ebcd26 100644 --- a/services/audioflinger/AudioMixer.cpp +++ b/services/audioflinger/AudioMixer.cpp @@ -18,6 +18,7 @@ #define LOG_TAG "AudioMixer" //#define LOG_NDEBUG 0 +#include <assert.h> #include <stdint.h> #include <string.h> #include <stdlib.h> @@ -161,13 +162,12 @@ void AudioMixer::disable() } } -status_t AudioMixer::setActiveTrack(int track) +void AudioMixer::setActiveTrack(int track) { - if (uint32_t(track-TRACK0) >= MAX_NUM_TRACKS) { - return BAD_VALUE; - } - mActiveTrack = track - TRACK0; - return NO_ERROR; + // this also catches track < TRACK0 + track -= TRACK0; + assert(uint32_t(track) < MAX_NUM_TRACKS); + mActiveTrack = track; } status_t AudioMixer::setParameter(int target, int name, void *value) @@ -324,10 +324,9 @@ void AudioMixer::track_t::adjustVolumeRamp(bool aux) } -status_t AudioMixer::setBufferProvider(AudioBufferProvider* buffer) +void AudioMixer::setBufferProvider(AudioBufferProvider* buffer) { mState.tracks[ mActiveTrack ].bufferProvider = buffer; - return NO_ERROR; } |