From 075abae2a954bf3edf18ad1705c2c0f188454ae0 Mon Sep 17 00:00:00 2001 From: Andy Hung Date: Wed, 9 Apr 2014 19:36:43 -0700 Subject: Add and enable multichannel for audio resampler Change-Id: I2b86fb73d70abc4c456f7567270a888086b301d4 Signed-off-by: Andy Hung --- services/audioflinger/AudioResampler.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'services/audioflinger/AudioResampler.cpp') diff --git a/services/audioflinger/AudioResampler.cpp b/services/audioflinger/AudioResampler.cpp index 562c4ea..b8a0357 100644 --- a/services/audioflinger/AudioResampler.cpp +++ b/services/audioflinger/AudioResampler.cpp @@ -259,13 +259,14 @@ AudioResampler::AudioResampler(int bitDepth, int inChannelCount, mPhaseFraction(0), mLocalTimeFreq(0), mPTS(AudioBufferProvider::kInvalidPTS), mQuality(quality) { // sanity check on format - if ((bitDepth != 16) ||(inChannelCount < 1) || (inChannelCount > 2)) { - ALOGE("Unsupported sample format, %d bits, %d channels", bitDepth, - inChannelCount); - // ALOG_ASSERT(0); + if ((bitDepth != 16 && (quality < DYN_LOW_QUALITY || bitDepth != 32)) + || inChannelCount < 1 + || inChannelCount > (quality < DYN_LOW_QUALITY ? 2 : 8)) { + LOG_ALWAYS_FATAL("Unsupported sample format %d quality %d bits, %d channels", + quality, bitDepth, inChannelCount); } if (sampleRate <= 0) { - ALOGE("Unsupported sample rate %d Hz", sampleRate); + LOG_ALWAYS_FATAL("Unsupported sample rate %d Hz", sampleRate); } // initialize common members -- cgit v1.1