commit e3e650f6512bba10535c76f22c43f85dda3d8005
parent 3f5d16c26e27ec58eda51483b368e9519213c911
Author: Andreas Pehrson <apehrson@mozilla.com>
Date: Thu, 23 Oct 2025 14:11:18 +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