This is an automated email from the git hooks/post-receive script.
richard pushed a commit to branch tor-browser-91.9esr-11.0-1 in repository tor-browser.
commit 520de8913f9849ee5d333ed9f50a4be25cfb51bc Author: Paul Adenot paul@paul.cx AuthorDate: Fri Apr 22 13:19:01 2022 +0000
Bug 1762620 - Only pad audio buffers when doing up mixing. r=alwu,a=dsmith
Differential Revision: https://phabricator.services.mozilla.com/D143623 --- dom/media/AudioConverter.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dom/media/AudioConverter.cpp b/dom/media/AudioConverter.cpp index d2eb7335a997f..1f5860804318e 100644 --- a/dom/media/AudioConverter.cpp +++ b/dom/media/AudioConverter.cpp @@ -156,8 +156,10 @@ static void dumbUpDownMix(TYPE* aOut, int32_t aOutChannels, const TYPE* aIn, for (int32_t j = 0; j < commonChannels; j++) { aOut[i * aOutChannels + j] = aIn[i * aInChannels + j]; } - for (int32_t j = 0; j < aInChannels - aOutChannels; j++) { - aOut[i * aOutChannels + j] = 0; + if (aOutChannels > aInChannels) { + for (int32_t j = 0; j < aInChannels - aOutChannels; j++) { + aOut[i * aOutChannels + j] = 0; + } } } }