commit 929f87f3a8cb3477f7f8b85bb39a1d6b09c84aec
parent 75a8cabbf0956fabe9c9718be7339706e31a7500
Author: Andreas Pehrson <apehrson@mozilla.com>
Date: Tue, 11 Nov 2025 08:20:23 +0000
Bug 1771789 - Make AudioInputProcessing::NumberOfChannels always valid. r=padenot,webrtc-reviewers,mjf
Differential Revision: https://phabricator.services.mozilla.com/D266395
Diffstat:
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