From 0fdb348584c1e0de76f5ce2ee81ccf7d7c78541a Mon Sep 17 00:00:00 2001 From: Paul Adenot Date: Mon, 5 Jan 2015 16:04:34 +0100 Subject: [PATCH] Backed out changeset 187fa323cec6 (bug 997870) --HG-- extra : rebase_source : afb3581dd9855fcacab840806020617df12d6afd --- dom/media/webaudio/OscillatorNode.cpp | 33 +++++++-------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/dom/media/webaudio/OscillatorNode.cpp b/dom/media/webaudio/OscillatorNode.cpp index e643fcdc2273..a5846ca807e9 100644 --- a/dom/media/webaudio/OscillatorNode.cpp +++ b/dom/media/webaudio/OscillatorNode.cpp @@ -151,15 +151,15 @@ public: { double frequency, detune; - // Shortcut if frequency-related AudioParam are not automated, and we - // already have computed the frequency information and related parameters. - if (!ParametersMayNeedUpdate()) { - return; - } - bool simpleFrequency = mFrequency.HasSimpleValue(); bool simpleDetune = mDetune.HasSimpleValue(); + // Shortcut if frequency-related AudioParam are not automated, and we + // already have computed the frequency information and related parameters. + if (simpleFrequency && simpleDetune && !mRecomputeParameters) { + return; + } + if (simpleFrequency) { frequency = mFrequency.GetValue(); } else { @@ -212,13 +212,6 @@ public: } } - bool ParametersMayNeedUpdate() - { - return mDetune.HasSimpleValue() || - mFrequency.HasSimpleValue() || - mRecomputeParameters; - } - void ComputeCustom(float* aOutput, StreamTime ticks, uint32_t aStart, @@ -238,22 +231,12 @@ public: // mPhase runs [0,periodicWaveSize) here instead of [0,2*M_PI). float basePhaseIncrement = mPeriodicWave->rateScale(); - bool parametersMayNeedUpdate = ParametersMayNeedUpdate(); - if (!parametersMayNeedUpdate) { + for (uint32_t i = aStart; i < aEnd; ++i) { + UpdateParametersIfNeeded(ticks, i); mPeriodicWave->waveDataForFundamentalFrequency(mFinalFrequency, lowerWaveData, higherWaveData, tableInterpolationFactor); - } - - for (uint32_t i = aStart; i < aEnd; ++i) { - if (parametersMayNeedUpdate) { - mPeriodicWave->waveDataForFundamentalFrequency(mFinalFrequency, - lowerWaveData, - higherWaveData, - tableInterpolationFactor); - UpdateParametersIfNeeded(ticks, i); - } // Bilinear interpolation between adjacent samples in each table. float floorPhase = floorf(mPhase); uint32_t j1 = floorPhase;