[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

kbr at google.com kbr at google.com
Wed Dec 22 18:07:47 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit c0a4fefe474bb4de8a4cdfa58612bdee148cd579
Author: kbr at google.com <kbr at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 7 21:45:04 2010 +0000

    2010-12-07  Kenneth Russell  <kbr at google.com>
    
            Reviewed by David Levin.
    
            Fix compilation of core web audio files on Windows
            https://bugs.webkit.org/show_bug.cgi?id=50603
    
            Added log2 definition to MathExtras.h on Windows platform.
    
            * wtf/MathExtras.h:
            (log2):
    2010-12-07  Kenneth Russell  <kbr at google.com>
    
            Reviewed by David Levin.
    
            Fix compilation of core web audio files on Windows
            https://bugs.webkit.org/show_bug.cgi?id=50603
    
            Changed a few constructs using C99 features of math.h to use
            wtf/MathExtras.h instead. Changed inline definitions of a couple of
            const static doubles in classes to out-of-line. Built Chrome with
            web audio enabled on Windows and Mac OS X to test these changes.
    
            No new tests since audio API is not yet implemented.
    
            * WebCore.gypi:
            * platform/audio/AudioResampler.cpp:
            * platform/audio/Biquad.cpp:
            (WebCore::Biquad::setLowpassParams):
            (WebCore::Biquad::setHighpassParams):
            (WebCore::Biquad::setLowShelfParams):
            * platform/audio/Cone.cpp:
            (WebCore::ConeEffect::gain):
            * platform/audio/EqualPowerPanner.cpp:
            (WebCore::EqualPowerPanner::pan):
            * platform/audio/FFTFrame.cpp:
            (WebCore::FFTFrame::interpolateFrequencyComponents):
            (WebCore::FFTFrame::extractAverageGroupDelay):
            (WebCore::FFTFrame::addConstantGroupDelay):
            * platform/audio/HRTFKernel.cpp:
            * platform/audio/HRTFPanner.cpp:
            * webaudio/AudioBufferSourceNode.cpp:
            (WebCore::AudioBufferSourceNode::readFromBufferWithGrainEnvelope):
            * webaudio/AudioPannerNode.cpp:
            (WebCore::AudioPannerNode::getAzimuthElevation):
            * webaudio/AudioParam.cpp: Added.
            (AudioParam::setValue):
            (AudioParam::smooth):
            * webaudio/AudioParam.h:
            * webaudio/RealtimeAnalyser.cpp:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73458 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 146797f..1092cff 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-12-07  Kenneth Russell  <kbr at google.com>
+
+        Reviewed by David Levin.
+
+        Fix compilation of core web audio files on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=50603
+
+        Added log2 definition to MathExtras.h on Windows platform.
+
+        * wtf/MathExtras.h:
+        (log2):
+
 2010-12-07  Antti Koivisto  <antti at apple.com>
 
         Reviewed by Gavin Barraclough.
diff --git a/JavaScriptCore/wtf/MathExtras.h b/JavaScriptCore/wtf/MathExtras.h
index 8a8741c..802ba29 100644
--- a/JavaScriptCore/wtf/MathExtras.h
+++ b/JavaScriptCore/wtf/MathExtras.h
@@ -145,6 +145,13 @@ inline float nextafterf(float x, float y) { return x > y ? x - FLT_EPSILON : x +
 inline double copysign(double x, double y) { return _copysign(x, y); }
 inline int isfinite(double x) { return _finite(x); }
 
+// MSVC's math.h does not currently supply log2.
+inline bool log2(double num)
+{
+    // This constant is roughly M_LN2, which is not provided by default on Windows.
+    return log(num) / 0.693147180559945309417232121458176568;
+}
+
 // Work around a bug in Win, where atan2(+-infinity, +-infinity) yields NaN instead of specific values.
 inline double wtf_atan2(double x, double y)
 {
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index bf230cc..fb95eb2 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,43 @@
+2010-12-07  Kenneth Russell  <kbr at google.com>
+
+        Reviewed by David Levin.
+
+        Fix compilation of core web audio files on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=50603
+
+        Changed a few constructs using C99 features of math.h to use
+        wtf/MathExtras.h instead. Changed inline definitions of a couple of
+        const static doubles in classes to out-of-line. Built Chrome with
+        web audio enabled on Windows and Mac OS X to test these changes.
+
+        No new tests since audio API is not yet implemented.
+
+        * WebCore.gypi:
+        * platform/audio/AudioResampler.cpp:
+        * platform/audio/Biquad.cpp:
+        (WebCore::Biquad::setLowpassParams):
+        (WebCore::Biquad::setHighpassParams):
+        (WebCore::Biquad::setLowShelfParams):
+        * platform/audio/Cone.cpp:
+        (WebCore::ConeEffect::gain):
+        * platform/audio/EqualPowerPanner.cpp:
+        (WebCore::EqualPowerPanner::pan):
+        * platform/audio/FFTFrame.cpp:
+        (WebCore::FFTFrame::interpolateFrequencyComponents):
+        (WebCore::FFTFrame::extractAverageGroupDelay):
+        (WebCore::FFTFrame::addConstantGroupDelay):
+        * platform/audio/HRTFKernel.cpp:
+        * platform/audio/HRTFPanner.cpp:
+        * webaudio/AudioBufferSourceNode.cpp:
+        (WebCore::AudioBufferSourceNode::readFromBufferWithGrainEnvelope):
+        * webaudio/AudioPannerNode.cpp:
+        (WebCore::AudioPannerNode::getAzimuthElevation):
+        * webaudio/AudioParam.cpp: Added.
+        (AudioParam::setValue):
+        (AudioParam::smooth):
+        * webaudio/AudioParam.h:
+        * webaudio/RealtimeAnalyser.cpp:
+
 2010-11-25  Philippe Normand  <pnormand at igalia.com>
 
         Reviewed by Martin Robinson.
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index bb4eb1c..4ba6155 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -4437,6 +4437,7 @@
             'webaudio/AudioNodeOutput.h',
             'webaudio/AudioPannerNode.h',
             'webaudio/AudioPannerNode.cpp',
+            'webaudio/AudioParam.cpp',
             'webaudio/AudioParam.h',
             'webaudio/AudioProcessingEvent.h',
             'webaudio/AudioProcessingEvent.cpp',
diff --git a/WebCore/platform/audio/AudioResampler.cpp b/WebCore/platform/audio/AudioResampler.cpp
index 7f8221e..ba5b58e 100644
--- a/WebCore/platform/audio/AudioResampler.cpp
+++ b/WebCore/platform/audio/AudioResampler.cpp
@@ -30,7 +30,7 @@
 
 #include "AudioBus.h"
 #include <algorithm>
-#include <math.h>
+#include <wtf/MathExtras.h>
 
 using namespace std;
  
diff --git a/WebCore/platform/audio/Biquad.cpp b/WebCore/platform/audio/Biquad.cpp
index 49f010b..20143e3 100644
--- a/WebCore/platform/audio/Biquad.cpp
+++ b/WebCore/platform/audio/Biquad.cpp
@@ -33,9 +33,8 @@
 #include "Biquad.h"
 
 #include <algorithm>
-#include <float.h>
-#include <math.h>
 #include <stdio.h>
+#include <wtf/MathExtras.h>
 
 #if OS(DARWIN)
 #include <Accelerate/Accelerate.h>
@@ -197,7 +196,7 @@ void Biquad::setLowpassParams(double cutoff, double resonance)
     double d = sqrt((4.0 - sqrt(16.0 - 16.0 / (g * g))) / 2.0);
 
     // Compute biquad coefficients for lopass filter
-    double theta = M_PI * cutoff;
+    double theta = piDouble * cutoff;
     double sn = 0.5 * d * sin(theta);
     double beta = 0.5 * (1.0 - sn) / (1.0 + sn);
     double gamma = (0.5 + beta) * cos(theta);
@@ -218,7 +217,7 @@ void Biquad::setHighpassParams(double cutoff, double resonance)
     double d = sqrt((4.0 - sqrt(16.0 - 16.0 / (g * g))) / 2.0);
 
     // Compute biquad coefficients for highpass filter
-    double theta = M_PI * cutoff;
+    double theta = piDouble * cutoff;
     double sn = 0.5 * d * sin(theta);
     double beta = 0.5 * (1.0 - sn) / (1.0 + sn);
     double gamma = (0.5 + beta) * cos(theta);
@@ -233,7 +232,7 @@ void Biquad::setHighpassParams(double cutoff, double resonance)
 
 void Biquad::setLowShelfParams(double cutoff, double dbGain)
 {
-    double theta = M_PI * cutoff;
+    double theta = piDouble * cutoff;
 
     double A = pow(10.0, dbGain / 40.0);
     double S = 1.0; // filter slope (1.0 is max value)
diff --git a/WebCore/platform/audio/Cone.cpp b/WebCore/platform/audio/Cone.cpp
index 843b3cc..f514cde 100644
--- a/WebCore/platform/audio/Cone.cpp
+++ b/WebCore/platform/audio/Cone.cpp
@@ -31,6 +31,7 @@
 #if ENABLE(WEB_AUDIO)
 
 #include "Cone.h"
+#include <wtf/MathExtras.h>
 
 namespace WebCore {
 
@@ -55,7 +56,7 @@ double ConeEffect::gain(FloatPoint3D sourcePosition, FloatPoint3D sourceOrientat
 
     // Angle between the source orientation vector and the source-listener vector
     double dotProduct = sourceToListener.dot(normalizedSourceOrientation);
-    double angle = 180.0 * acos(dotProduct) / M_PI;
+    double angle = 180.0 * acos(dotProduct) / piDouble;
     double absAngle = fabs(angle);
 
     // Divide by 2.0 here since API is entire angle (not half-angle)
diff --git a/WebCore/platform/audio/EqualPowerPanner.cpp b/WebCore/platform/audio/EqualPowerPanner.cpp
index 2e4e10f..002b7c6 100644
--- a/WebCore/platform/audio/EqualPowerPanner.cpp
+++ b/WebCore/platform/audio/EqualPowerPanner.cpp
@@ -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.
diff --git a/WebCore/platform/audio/FFTFrame.cpp b/WebCore/platform/audio/FFTFrame.cpp
index 17292b6..d9979d9 100644
--- a/WebCore/platform/audio/FFTFrame.cpp
+++ b/WebCore/platform/audio/FFTFrame.cpp
@@ -134,32 +134,32 @@ void FFTFrame::interpolateFrequencyComponents(const FFTFrame& frame1, const FFTF
         lastPhase2 = phase2;
 
         // Unwrap phase deltas
-        if (deltaPhase1 > M_PI)
-            deltaPhase1 -= 2.0 * M_PI;
-        if (deltaPhase1 < -M_PI)
-            deltaPhase1 += 2.0 * M_PI;
-        if (deltaPhase2 > M_PI)
-            deltaPhase2 -= 2.0 * M_PI;
-        if (deltaPhase2 < -M_PI)
-            deltaPhase2 += 2.0 * M_PI;
+        if (deltaPhase1 > piDouble)
+            deltaPhase1 -= 2.0 * piDouble;
+        if (deltaPhase1 < -piDouble)
+            deltaPhase1 += 2.0 * piDouble;
+        if (deltaPhase2 > piDouble)
+            deltaPhase2 -= 2.0 * piDouble;
+        if (deltaPhase2 < -piDouble)
+            deltaPhase2 += 2.0 * piDouble;
 
         // Blend group-delays
         double deltaPhaseBlend;
 
-        if (deltaPhase1 - deltaPhase2 > M_PI)
-            deltaPhaseBlend = s1 * deltaPhase1 + s2 * (2.0 * M_PI + deltaPhase2);
-        else if (deltaPhase2 - deltaPhase1 > M_PI)
-            deltaPhaseBlend = s1 * (2.0 * M_PI + deltaPhase1) + s2 * deltaPhase2;
+        if (deltaPhase1 - deltaPhase2 > piDouble)
+            deltaPhaseBlend = s1 * deltaPhase1 + s2 * (2.0 * piDouble + deltaPhase2);
+        else if (deltaPhase2 - deltaPhase1 > piDouble)
+            deltaPhaseBlend = s1 * (2.0 * piDouble + deltaPhase1) + s2 * deltaPhase2;
         else
             deltaPhaseBlend = s1 * deltaPhase1 + s2 * deltaPhase2;
 
         phaseAccum += deltaPhaseBlend;
 
         // Unwrap
-        if (phaseAccum > M_PI)
-            phaseAccum -= 2.0 * M_PI;
-        if (phaseAccum < -M_PI)
-            phaseAccum += 2.0 * M_PI;
+        if (phaseAccum > piDouble)
+            phaseAccum -= 2.0 * piDouble;
+        if (phaseAccum < -piDouble)
+            phaseAccum += 2.0 * piDouble;
 
         Complex c = complexFromMagnitudePhase(mag, phaseAccum);
 
@@ -179,7 +179,7 @@ double FFTFrame::extractAverageGroupDelay()
 
     int halfSize = fftSize() / 2;
 
-    const double kSamplePhaseDelay = (2.0 * M_PI) / double(fftSize());
+    const double kSamplePhaseDelay = (2.0 * piDouble) / double(fftSize());
 
     // Calculate weighted average group delay
     for (int i = 0; i < halfSize; i++) {
@@ -191,10 +191,10 @@ double FFTFrame::extractAverageGroupDelay()
         lastPhase = phase;
 
         // Unwrap
-        if (deltaPhase < -M_PI)
-            deltaPhase += 2.0 * M_PI;
-        if (deltaPhase > M_PI)
-            deltaPhase -= 2.0 * M_PI;
+        if (deltaPhase < -piDouble)
+            deltaPhase += 2.0 * piDouble;
+        if (deltaPhase > piDouble)
+            deltaPhase -= 2.0 * piDouble;
 
         aveSum += mag * deltaPhase;
         weightSum += mag;
@@ -224,7 +224,7 @@ void FFTFrame::addConstantGroupDelay(double sampleFrameDelay)
     float* realP = realData();
     float* imagP = imagData();
 
-    const double kSamplePhaseDelay = (2.0 * M_PI) / double(fftSize());
+    const double kSamplePhaseDelay = (2.0 * piDouble) / double(fftSize());
 
     double phaseAdj = -sampleFrameDelay * kSamplePhaseDelay;
 
diff --git a/WebCore/platform/audio/HRTFKernel.cpp b/WebCore/platform/audio/HRTFKernel.cpp
index 852cdbf..22d4b12 100644
--- a/WebCore/platform/audio/HRTFKernel.cpp
+++ b/WebCore/platform/audio/HRTFKernel.cpp
@@ -35,6 +35,7 @@
 #include "AudioChannel.h"
 #include "Biquad.h"
 #include "FFTFrame.h"
+#include <wtf/MathExtras.h>
 
 using namespace std;
 
diff --git a/WebCore/platform/audio/HRTFPanner.cpp b/WebCore/platform/audio/HRTFPanner.cpp
index 56f06f1..68bc505 100644
--- a/WebCore/platform/audio/HRTFPanner.cpp
+++ b/WebCore/platform/audio/HRTFPanner.cpp
@@ -33,7 +33,7 @@
 #include "HRTFDatabase.h"
 #include "HRTFDatabaseLoader.h"
 #include <algorithm>
-#include <math.h>
+#include <wtf/MathExtras.h>
 #include <wtf/RefPtr.h>
 
 using namespace std;
diff --git a/WebCore/webaudio/AudioBufferSourceNode.cpp b/WebCore/webaudio/AudioBufferSourceNode.cpp
index 7aaeb04..05abed8 100644
--- a/WebCore/webaudio/AudioBufferSourceNode.cpp
+++ b/WebCore/webaudio/AudioBufferSourceNode.cpp
@@ -31,6 +31,7 @@
 #include "AudioContext.h"
 #include "AudioNodeOutput.h"
 #include <algorithm>
+#include <wtf/MathExtras.h>
 
 using namespace std;
 
@@ -324,7 +325,7 @@ void AudioBufferSourceNode::readFromBufferWithGrainEnvelope(float* sourceL, floa
         m_grainFrameCount++;
 
         x = min(1.0f, x);
-        float grainEnvelope = sinf(M_PI * x);
+        float grainEnvelope = sinf(piFloat * x);
         
         *destinationL++ = grainEnvelope * *sourceL++;
 
diff --git a/WebCore/webaudio/AudioPannerNode.cpp b/WebCore/webaudio/AudioPannerNode.cpp
index 5cd17cb..5c94763 100644
--- a/WebCore/webaudio/AudioPannerNode.cpp
+++ b/WebCore/webaudio/AudioPannerNode.cpp
@@ -193,7 +193,7 @@ void AudioPannerNode::getAzimuthElevation(double* outAzimuth, double* outElevati
     FloatPoint3D projectedSource = sourceListener - upProjection * up;
     projectedSource.normalize();
 
-    azimuth = 180.0 * acos(projectedSource.dot(listenerRight)) / M_PI;
+    azimuth = 180.0 * acos(projectedSource.dot(listenerRight)) / piDouble;
     fixNANs(azimuth); // avoid illegal values
 
     // Source  in front or behind the listener
@@ -208,7 +208,7 @@ void AudioPannerNode::getAzimuthElevation(double* outAzimuth, double* outElevati
         azimuth = 450.0 - azimuth;
 
     // Elevation
-    double elevation = 90.0 - 180.0 * acos(sourceListener.dot(up)) / M_PI;
+    double elevation = 90.0 - 180.0 * acos(sourceListener.dot(up)) / piDouble;
     fixNANs(azimuth); // avoid illegal values
 
     if (elevation > 90.0)
diff --git a/WebCore/webaudio/AudioParam.cpp b/WebCore/webaudio/AudioParam.cpp
new file mode 100644
index 0000000..dcf918f
--- /dev/null
+++ b/WebCore/webaudio/AudioParam.cpp
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "AudioParam.h"
+
+#include <wtf/MathExtras.h>
+
+namespace WebCore {
+
+const double AudioParam::DefaultSmoothingConstant = 0.05;
+const double AudioParam::SnapThreshold = 0.001;
+
+void AudioParam::setValue(float value)
+{
+    // Check against JavaScript giving us bogus floating-point values.
+    // Don't ASSERT, since this can happen if somebody writes bad JS.
+    if (!isnan(value) && !isinf(value))
+        m_value = value;
+}
+
+bool AudioParam::smooth()
+{
+    if (m_smoothedValue == m_value) {
+        // Smoothed value has already approached and snapped to value.
+        return true;
+    }
+
+    // Exponential approach
+    m_smoothedValue += (m_value - m_smoothedValue) * m_smoothingConstant;
+
+    // If we get close enough then snap to actual value.
+    if (fabs(m_smoothedValue - m_value) < SnapThreshold) // FIXME: the threshold needs to be adjustable depending on range - but this is OK general purpose value.
+        m_smoothedValue = m_value;
+
+    return false;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/webaudio/AudioParam.h b/WebCore/webaudio/AudioParam.h
index 7643cf3..88b7615 100644
--- a/WebCore/webaudio/AudioParam.h
+++ b/WebCore/webaudio/AudioParam.h
@@ -30,7 +30,6 @@
 #define AudioParam_h
 
 #include "PlatformString.h"
-#include <math.h>
 #include <sys/types.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
@@ -39,8 +38,8 @@ namespace WebCore {
 
 class AudioParam : public RefCounted<AudioParam> {
 public:
-    static const double DefaultSmoothingConstant = 0.05;
-    static const double SnapThreshold = 0.001;
+    static const double DefaultSmoothingConstant;
+    static const double SnapThreshold;
 
     static PassRefPtr<AudioParam> create(const String& name, double defaultValue, double minValue, double maxValue, unsigned units = 0)
     {
@@ -61,13 +60,7 @@ public:
 
     float value() const { return static_cast<float>(m_value); }
     
-    void setValue(float value)
-    {
-        // Check against JavaScript giving us bogus floating-point values.
-        // Don't ASSERT, since this can happen if somebody writes bad JS.
-        if (!isnan(value) && !isinf(value))
-            m_value = value;
-    }
+    void setValue(float);
 
     String name() const { return m_name; }
 
@@ -84,22 +77,7 @@ public:
 
     // Smoothly exponentially approaches to (de-zippers) the desired value.
     // Returns true if smoothed value has already snapped exactly to value.
-    bool smooth()
-    {
-        if (m_smoothedValue == m_value) {
-            // Smoothed value has already approached and snapped to value.
-            return true;
-        }
-
-        // Exponential approach
-        m_smoothedValue += (m_value - m_smoothedValue) * m_smoothingConstant;
-
-        // If we get close enough then snap to actual value.
-        if (fabs(m_smoothedValue - m_value) < SnapThreshold) // FIXME: the threshold needs to be adjustable depending on range - but this is OK general purpose value.
-            m_smoothedValue = m_value;
-
-        return false;
-    }
+    bool smooth();
 
     void resetSmoothedValue() { m_smoothedValue = m_value; }
     void setSmoothingConstant(double k) { m_smoothingConstant = k; }
diff --git a/WebCore/webaudio/RealtimeAnalyser.cpp b/WebCore/webaudio/RealtimeAnalyser.cpp
index 282f299..30a7de1 100644
--- a/WebCore/webaudio/RealtimeAnalyser.cpp
+++ b/WebCore/webaudio/RealtimeAnalyser.cpp
@@ -40,6 +40,7 @@
 #include <algorithm>
 #include <limits.h>
 #include <wtf/Complex.h>
+#include <wtf/MathExtras.h>
 #include <wtf/Threading.h>
 
 using namespace std;
@@ -137,7 +138,7 @@ void applyWindow(float* p, size_t n)
     
     for (unsigned i = 0; i < n; ++i) {
         double x = static_cast<double>(i) / static_cast<double>(n);
-        double window = a0 - a1 * cos(2.0 * M_PI * x) + a2 * cos(4.0 * M_PI * x);
+        double window = a0 - a1 * cos(2.0 * piDouble * x) + a2 * cos(4.0 * piDouble * x);
         p[i] *= float(window);
     }
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list