Bug 1436096 - PannerNode noop optimization for equal power is valid on stereo source. r=padenot
authorAlex Chronopoulos <achronop@gmail.com>
Fri, 02 Mar 2018 20:47:34 +0200
changeset 461926 af9b9ffd4750dfa9a1bc579ceb190297f70d6d33
parent 461925 6024410244a9e556227f31ba898b36514ab66ac1
child 461927 c3f5ebf5eda63aadc5a13d5c89c1056448a11e72
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1436096
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1436096 - PannerNode noop optimization for equal power is valid on stereo source. r=padenot MozReview-Commit-ID: FwDYQyqr4wr
dom/media/webaudio/PannerNode.cpp
--- 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);