commit 518739908a77156140f309e269ba850fb5fe9807
parent 79210b6b6b8c893ff44ef46d18a81fd8a99b2be5
Author: Karl Tomlinson <karlt+@karlt.net>
Date: Tue, 16 Dec 2025 08:41:30 +0000
Bug 2005992 Simplify needInputProcessingParamUpdate logic in CheckDriver() r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D276411
Diffstat:
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/dom/media/MediaTrackGraph.cpp b/dom/media/MediaTrackGraph.cpp
@@ -449,11 +449,6 @@ void MediaTrackGraphImpl::CheckDriver() {
return;
}
- bool needInputProcessingParamUpdate =
- processingRequest &&
- processingRequest->mGeneration !=
- audioCallbackDriver->RequestedInputProcessingParams().mGeneration;
-
// Check if this graph should switch to a different number of output channels.
// Generally, a driver switch is explicitly made by an event (e.g., setting
// the AudioDestinationNode channelCount), but if an HTMLMediaElement is
@@ -461,18 +456,17 @@ void MediaTrackGraphImpl::CheckDriver() {
// of the media determines how many channels to output, and it can change
// dynamically.
if (primaryOutputChannelCount != audioCallbackDriver->OutputChannelCount()) {
- if (needInputProcessingParamUpdate) {
- needInputProcessingParamUpdate = false;
- }
AudioCallbackDriver* driver = new AudioCallbackDriver(
this, CurrentDriver(), mSampleRate, primaryOutputChannelCount,
inputChannelCount, PrimaryOutputDeviceID(), inputDevice,
inputPreference, processingRequest);
SwitchAtNextIteration(driver);
+ return;
}
- if (needInputProcessingParamUpdate) {
- needInputProcessingParamUpdate = false;
+ if (processingRequest &&
+ processingRequest->mGeneration !=
+ audioCallbackDriver->RequestedInputProcessingParams().mGeneration) {
LOG(LogLevel::Debug,
("%p: Setting on the fly requested processing params %s (Gen %d)", this,
CubebUtils::ProcessingParamsToString(processingRequest->mParams).get(),