Bug 916285 - Fix bustage on windows.
authorPaul Adenot <paul@paul.cx>
Mon, 05 Jan 2015 15:30:53 +0100
changeset 222766 b8d51d20fd97aca487d04b7bf0f57cf31c954e4e
parent 222765 186c02fdb2218b2d15d583dca7c8f5e6fd7c2088
child 222767 238eeecce596d5158217b64a5ddda4a96918a66b
push id10716
push userkwierso@gmail.com
push dateFri, 09 Jan 2015 01:17:28 +0000
treeherderfx-team@0f98d51a4a49 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs916285
milestone37.0a1
Bug 916285 - Fix bustage on windows.
dom/media/webaudio/OscillatorNode.cpp
--- a/dom/media/webaudio/OscillatorNode.cpp
+++ b/dom/media/webaudio/OscillatorNode.cpp
@@ -136,21 +136,22 @@ public:
     MOZ_ASSERT(mCustom->GetChannels() == 2,
                "PeriodicWave should have sent two channels");
     mPeriodicWave = WebCore::PeriodicWave::create(mSource->SampleRate(),
     mCustom->GetData(0), mCustom->GetData(1), mCustomLength);
   }
 
   void IncrementPhase()
   {
+    const float twoPiFloat = float(2 * M_PI);
     mPhase += mPhaseIncrement;
-    if (mPhase > 2 * M_PI) {
-      mPhase -= 2 * M_PI;
-    } else if (mPhase < -2 * M_PI) {
-      mPhase += 2 * M_PI;
+    if (mPhase > twoPiFloat) {
+      mPhase -= twoPiFloat;
+    } else if (mPhase < -twoPiFloat) {
+      mPhase += twoPiFloat;
     }
   }
 
   void UpdateParametersIfNeeded(StreamTime ticks, size_t count)
   {
     double frequency, detune;
 
     // Shortcut if frequency-related AudioParam are not automated, and we