Bug 1436096 - PannerNode noop optimization for equal power is valid on stereo source. r?padenot
MozReview-Commit-ID: FwDYQyqr4wr
--- a/dom/media/webaudio/PannerNode.cpp
+++ b/dom/media/webaudio/PannerNode.cpp
@@ -472,19 +472,20 @@ PannerNodeEngine::EqualPowerPanningFunct
mOrientationZ.HasSimpleValue()) {
ThreeDPoint position = ConvertAudioParamTimelineTo3DP(mPositionX, mPositionY, mPositionZ, tick);
ThreeDPoint orientation = ConvertAudioParamTimelineTo3DP(mOrientationX, mOrientationY, mOrientationZ, tick);
if (!orientation.IsZero()) {
orientation.Normalize();
}
- // If both the listener are in the same spot, and no cone gain is specified,
- // this node is noop.
- if (mListenerPosition == position &&
+ // For a stereo source, when both the listener and the panner are in
+ // the same spot, and no cone gain is specified, this node is noop.
+ if (inputChannels == 2 &&
+ mListenerPosition == position &&
mConeInnerAngle == 360 &&
mConeOuterAngle == 360) {
*aOutput = aInput;
return;
}
// The output of this node is always stereo, no matter what the inputs are.
aOutput->AllocateChannels(2);