Bug 1675878 - Don't resample high-sample-rate audio down to a standard rate. r=jya

Differential Revision: https://phabricator.services.mozilla.com/D97018
This commit is contained in:
Paul Adenot 2020-11-16 14:33:46 +00:00
parent ce553ffb6c
commit 2b0b162565

View File

@ -188,11 +188,9 @@ uint32_t DecideAudioPlaybackSampleRate(const AudioInfo& aInfo) {
if (resampling) {
rate = 48000;
} else if (aInfo.mRate == 44100 || aInfo.mRate == 48000) {
} else if (aInfo.mRate >= 44100) {
// The original rate is of good quality and we want to minimize unecessary
// resampling. The common scenario being that the sampling rate is one or
// the other. This minimizes audio quality regressions but depends on
// content providers not changing rates mid-stream.
// resampling, so we let cubeb decide how to resample (if needed).
rate = aInfo.mRate;
} else {
// We will resample all data to match cubeb's preferred sampling rate.