summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioResampler.cpp
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2014-04-09 19:36:43 -0700
committerAndy Hung <hunga@google.com>2014-07-02 16:00:53 -0700
commit075abae2a954bf3edf18ad1705c2c0f188454ae0 (patch)
treea2fdfffb6a6831a082a1367c303d542ae9f9c286 /services/audioflinger/AudioResampler.cpp
parent68ffa200de7c4662c088851a328923be715c6c24 (diff)
downloadframeworks_av-075abae2a954bf3edf18ad1705c2c0f188454ae0.zip
frameworks_av-075abae2a954bf3edf18ad1705c2c0f188454ae0.tar.gz
frameworks_av-075abae2a954bf3edf18ad1705c2c0f188454ae0.tar.bz2
Add and enable multichannel for audio resampler
Change-Id: I2b86fb73d70abc4c456f7567270a888086b301d4 Signed-off-by: Andy Hung <hunga@google.com>
Diffstat (limited to 'services/audioflinger/AudioResampler.cpp')
-rw-r--r--services/audioflinger/AudioResampler.cpp11
1 files changed, 6 insertions, 5 deletions
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