2010-12-07 Kenneth Russell <kbr@google.com>
[WebKit.git] / WebCore / platform / audio / EqualPowerPanner.cpp
index 2e4e10f1e63637b3b044b6126f8f00598dc737ec..002b7c6528b570c163a8c833064248522e50390f 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "AudioBus.h"
 #include "AudioUtilities.h"
-#include <math.h>
+#include <wtf/MathExtras.h>
 
 // Use a 50ms smoothing / de-zippering time-constant.
 const double SmoothingTimeConstant = 0.050;
@@ -76,7 +76,7 @@ void EqualPowerPanner::pan(double azimuth, double /*elevation*/, AudioBus* input
     else
         desiredPanPosition = (azimuth + 30.0) / 60.0;
 
-    double desiredGainL = 0.5 * cos(M_PI * desiredPanPosition) + 0.5;
+    double desiredGainL = 0.5 * cos(piDouble * desiredPanPosition) + 0.5;
     double desiredGainR = sqrt(1.0 - desiredGainL*desiredGainL);
 
     // Don't de-zipper on first render call.