Bug 916285 - Fix bustage on windows.
authorPaul Adenot <paul@paul.cx>
Mon, 05 Jan 2015 15:30:53 +0100
changeset 222758 b8d51d20fd97aca487d04b7bf0f57cf31c954e4e
parent 222757 186c02fdb2218b2d15d583dca7c8f5e6fd7c2088
child 222759 238eeecce596d5158217b64a5ddda4a96918a66b
push id28073
push userkwierso@gmail.com
push dateFri, 09 Jan 2015 01:08:23 +0000
treeherdermozilla-central@b3f84cf78dc2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs916285
milestone37.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 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