tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit e8577e2415aa670712abdaa829389f03c2a97800
parent 9a636bdf6176241e3b91cab5beb9d6d88cbab413
Author: Andreas Pehrson <apehrson@mozilla.com>
Date:   Tue, 14 Oct 2025 18:35:42 +0000

Bug 1771789 - Make AudioInputProcessing::NumberOfChannels always valid. r=padenot,webrtc-reviewers,mjf

Differential Revision: https://phabricator.services.mozilla.com/D266395

Diffstat:
Mdom/media/webrtc/MediaEngineWebRTCAudio.h | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/dom/media/webrtc/MediaEngineWebRTCAudio.h b/dom/media/webrtc/MediaEngineWebRTCAudio.h @@ -318,9 +318,13 @@ class AudioProcessingTrack : public DeviceInputConsumerTrack { void DestroyImpl() override; void ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags) override; uint32_t NumberOfChannels() const override { - MOZ_DIAGNOSTIC_ASSERT( - mInputProcessing, - "Must set mInputProcessing before exposing to content"); + if (!mInputProcessing) { + // There's an async gap between adding the track to the graph + // (AudioProcessingTrack::Create) and setting mInputProcessing + // (SetInputProcessing on the media manager thread). + // Return 0 to indicate the default within this gap. + return 0; + } return mInputProcessing->GetRequestedInputChannelCount(); } // Pass the graph's mixed audio output to mInputProcessing for processing as