revert 3171b6ad0055 b=907986
authorKarl Tomlinson <karlt+@karlt.net>
Wed, 04 Sep 2013 15:02:04 +1200
changeset 153956 e3902838eda4a7d248ac27d4bcae62c3622d9d16
parent 153955 f88e5c1c9499ed7bd280b1efbe695a3088748916
child 153957 b2bd6347837baa403fc043c4bdc6fcb24d0d3449
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs907986
milestone25.0a2
revert 3171b6ad0055 b=907986
content/media/webaudio/PannerNode.cpp
--- a/content/media/webaudio/PannerNode.cpp
+++ b/content/media/webaudio/PannerNode.cpp
@@ -438,18 +438,21 @@ PannerNodeEngine::ComputeConeGain()
   if (mOrientation.IsZero() || ((mConeInnerAngle == 360) && (mConeOuterAngle == 360))) {
     return 1;
   }
 
   // Normalized source-listener vector
   ThreeDPoint sourceToListener = mListenerPosition - mPosition;
   sourceToListener.Normalize();
 
+  ThreeDPoint normalizedSourceOrientation = mOrientation;
+  normalizedSourceOrientation.Normalize();
+
   // Angle between the source orientation vector and the source-listener vector
-  double dotProduct = sourceToListener.DotProduct(mOrientation);
+  double dotProduct = sourceToListener.DotProduct(normalizedSourceOrientation);
   double angle = 180 * acos(dotProduct) / M_PI;
   double absAngle = fabs(angle);
 
   // Divide by 2 here since API is entire angle (not half-angle)
   double absInnerAngle = fabs(mConeInnerAngle) / 2;
   double absOuterAngle = fabs(mConeOuterAngle) / 2;
   double gain = 1;