diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
commit | def92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch) | |
tree | 2ef34b9ad8bb9a9220e05d60352558b15f513894 /dom/media/VideoUtils.cpp | |
parent | Adding debian version 125.0.3-1. (diff) | |
download | firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/VideoUtils.cpp')
-rw-r--r-- | dom/media/VideoUtils.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/dom/media/VideoUtils.cpp b/dom/media/VideoUtils.cpp index 90057f7c83..24b1f0dd59 100644 --- a/dom/media/VideoUtils.cpp +++ b/dom/media/VideoUtils.cpp @@ -188,12 +188,13 @@ uint32_t DecideAudioPlaybackSampleRate(const AudioInfo& aInfo, rate = 48000; } else if (aInfo.mRate >= 44100) { // The original rate is of good quality and we want to minimize unecessary - // resampling, so we let cubeb decide how to resample (if needed). - rate = aInfo.mRate; + // resampling, so we let cubeb decide how to resample (if needed). Cap to + // 384kHz for good measure. + rate = std::min<unsigned>(aInfo.mRate, 384000u); } else { // We will resample all data to match cubeb's preferred sampling rate. rate = CubebUtils::PreferredSampleRate(aShouldResistFingerprinting); - if (rate > 384000) { + if (rate > 768000) { // bogus rate, fall back to something else; rate = 48000; } |