diff options
author | Andy Hung <hunga@google.com> | 2014-08-11 20:26:28 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-11 18:20:32 +0000 |
commit | 306c92dabc524f408445f7da2524c7a5e77ade63 (patch) | |
tree | 3e7b9269223865424df13a4efc513ecfe57af69c /services/audioflinger/Threads.cpp | |
parent | de975ca87c3dbdf9b7d92dae54b3446670b2a50e (diff) | |
parent | cd04484f4837b8ca0041d118286ab6a98e84fc75 (diff) | |
download | frameworks_av-306c92dabc524f408445f7da2524c7a5e77ade63.zip frameworks_av-306c92dabc524f408445f7da2524c7a5e77ade63.tar.gz frameworks_av-306c92dabc524f408445f7da2524c7a5e77ade63.tar.bz2 |
Merge "Extend downsampling ratios greater than 2:1" into lmp-dev
Diffstat (limited to 'services/audioflinger/Threads.cpp')
-rw-r--r-- | services/audioflinger/Threads.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 7d583bb..30cebf4 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -26,6 +26,7 @@ #include <sys/stat.h> #include <cutils/properties.h> #include <media/AudioParameter.h> +#include <media/AudioResamplerPublic.h> #include <utils/Log.h> #include <utils/Trace.h> @@ -1479,8 +1480,7 @@ sp<AudioFlinger::PlaybackThread::Track> AudioFlinger::PlaybackThread::createTrac lStatus = BAD_VALUE; goto Exit; } - // Resampler implementation limits input sampling rate to 2 x output sampling rate. - if (sampleRate > mSampleRate*2) { + if (sampleRate > mSampleRate * AUDIO_RESAMPLER_DOWN_RATIO_MAX) { ALOGE("Sample rate out of range: %u mSampleRate %u", sampleRate, mSampleRate); lStatus = BAD_VALUE; goto Exit; @@ -3500,7 +3500,7 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTrac AudioMixer::TRACK, AudioMixer::MIXER_CHANNEL_MASK, (void *)(uintptr_t)mChannelMask); // limit track sample rate to 2 x output sample rate, which changes at re-configuration - uint32_t maxSampleRate = mSampleRate * 2; + uint32_t maxSampleRate = mSampleRate * AUDIO_RESAMPLER_DOWN_RATIO_MAX; uint32_t reqSampleRate = track->mAudioTrackServerProxy->getSampleRate(); if (reqSampleRate == 0) { reqSampleRate = mSampleRate; |