From 3348e36c51e91e78020bcc6578eda83d97c31bec Mon Sep 17 00:00:00 2001 From: Andy Hung Date: Mon, 7 Jul 2014 10:21:44 -0700 Subject: Replace int bitDepth with audio_format_t in Resampler Remove mBitDepth from class (not used). Replace with audio_format_t in factory method to distinguish between float and pcm 16-bit. Change-Id: I166860796c68285077ef4458d8758d19b82523f9 --- services/audioflinger/AudioMixer.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'services/audioflinger/AudioMixer.cpp') diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp index af312c4..4dbbc43 100644 --- a/services/audioflinger/AudioMixer.cpp +++ b/services/audioflinger/AudioMixer.cpp @@ -763,21 +763,9 @@ bool AudioMixer::track_t::setResampler(uint32_t value, uint32_t devSampleRate) quality = AudioResampler::DEFAULT_QUALITY; } - int bits; - switch (mMixerInFormat) { - case AUDIO_FORMAT_PCM_16_BIT: - bits = 16; - break; - case AUDIO_FORMAT_PCM_FLOAT: - bits = 32; // 32 bits to the AudioResampler::create() indicates float. - break; - default: - LOG_ALWAYS_FATAL("Invalid mMixerInFormat: %#x", mMixerInFormat); - break; - } ALOGVV("Creating resampler with %d bits\n", bits); resampler = AudioResampler::create( - bits, + mMixerInFormat, // the resampler sees the number of channels after the downmixer, if any (int) (downmixerBufferProvider != NULL ? MAX_NUM_CHANNELS : channelCount), devSampleRate, quality); -- cgit v1.1