Loading services/audioflinger/AudioMixer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -536,7 +536,7 @@ bool AudioMixer::track_t::setResampler(uint32_t value, uint32_t devSampleRate) // Should have a way to distinguish tracks with static ratios vs. dynamic ratios. if (!((value == 44100 && devSampleRate == 48000) || (value == 48000 && devSampleRate == 44100))) { quality = AudioResampler::LOW_QUALITY; quality = AudioResampler::DYN_LOW_QUALITY; } else { quality = AudioResampler::DEFAULT_QUALITY; } Loading services/audioflinger/AudioResampler.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -158,6 +158,16 @@ AudioResampler* AudioResampler::create(int bitDepth, int inChannelCount, atFinalQuality = true; } /* if the caller requests DEFAULT_QUALITY and af.resampler.property * has not been set, the target resampler quality is set to DYN_MED_QUALITY, * and allowed to "throttle" down to DYN_LOW_QUALITY if necessary * due to estimated CPU load of having too many active resamplers * (the code below the if). */ if (quality == DEFAULT_QUALITY) { quality = DYN_MED_QUALITY; } // naive implementation of CPU load throttling doesn't account for whether resampler is active pthread_mutex_lock(&mutex); for (;;) { Loading @@ -172,7 +182,6 @@ AudioResampler* AudioResampler::create(int bitDepth, int inChannelCount, // not enough CPU available for proposed quality level, so try next lowest level switch (quality) { default: case DEFAULT_QUALITY: case LOW_QUALITY: atFinalQuality = true; break; Loading Loading @@ -202,7 +211,6 @@ AudioResampler* AudioResampler::create(int bitDepth, int inChannelCount, switch (quality) { default: case DEFAULT_QUALITY: case LOW_QUALITY: ALOGV("Create linear Resampler"); resampler = new AudioResamplerOrder1(bitDepth, inChannelCount, sampleRate); Loading Loading
services/audioflinger/AudioMixer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -536,7 +536,7 @@ bool AudioMixer::track_t::setResampler(uint32_t value, uint32_t devSampleRate) // Should have a way to distinguish tracks with static ratios vs. dynamic ratios. if (!((value == 44100 && devSampleRate == 48000) || (value == 48000 && devSampleRate == 44100))) { quality = AudioResampler::LOW_QUALITY; quality = AudioResampler::DYN_LOW_QUALITY; } else { quality = AudioResampler::DEFAULT_QUALITY; } Loading
services/audioflinger/AudioResampler.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -158,6 +158,16 @@ AudioResampler* AudioResampler::create(int bitDepth, int inChannelCount, atFinalQuality = true; } /* if the caller requests DEFAULT_QUALITY and af.resampler.property * has not been set, the target resampler quality is set to DYN_MED_QUALITY, * and allowed to "throttle" down to DYN_LOW_QUALITY if necessary * due to estimated CPU load of having too many active resamplers * (the code below the if). */ if (quality == DEFAULT_QUALITY) { quality = DYN_MED_QUALITY; } // naive implementation of CPU load throttling doesn't account for whether resampler is active pthread_mutex_lock(&mutex); for (;;) { Loading @@ -172,7 +182,6 @@ AudioResampler* AudioResampler::create(int bitDepth, int inChannelCount, // not enough CPU available for proposed quality level, so try next lowest level switch (quality) { default: case DEFAULT_QUALITY: case LOW_QUALITY: atFinalQuality = true; break; Loading Loading @@ -202,7 +211,6 @@ AudioResampler* AudioResampler::create(int bitDepth, int inChannelCount, switch (quality) { default: case DEFAULT_QUALITY: case LOW_QUALITY: ALOGV("Create linear Resampler"); resampler = new AudioResamplerOrder1(bitDepth, inChannelCount, sampleRate); Loading