Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5fdf27f7 authored by Mingming Yin's avatar Mingming Yin Committed by Gerrit - the friendly Code Review server
Browse files

audioflinger: update samplerate check to use QTI resampler

- QTI resampler supports only up to 192kHz.
  Use default resampler when sample rate is higher than 192kHz

Change-Id: Ia6f52e657f79d9cbf7f2b6e1fe16c2c7f5373f00
CRs-Fixed: 804204
parent 0206741a
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -81,6 +81,9 @@ static const bool kUseFloat = true;
// Set to default copy buffer size in frames for input processing.
static const size_t kCopyBufferFrameCount = 256;

#ifdef QTI_RESAMPLER
#define QTI_RESAMPLER_MAX_SAMPLERATE 192000
#endif
namespace android {

// ----------------------------------------------------------------------------
@@ -970,7 +973,9 @@ bool AudioMixer::track_t::setResampler(uint32_t trackSampleRate, uint32_t devSam
                // quality level based on the initial ratio, but that could change later.
                // Should have a way to distinguish tracks with static ratios vs. dynamic ratios.
#ifdef QTI_RESAMPLER
                if ((trackSampleRate > devSampleRate * 2) && (devSampleRate == 48000)) {
                if ((trackSampleRate <= QTI_RESAMPLER_MAX_SAMPLERATE) &&
                       (trackSampleRate > devSampleRate * 2) &&
                       (devSampleRate == 48000)) {
                    quality = AudioResampler::QTI_QUALITY;
                } else
#endif