diff --git a/dom/media/webaudio/AudioBufferSourceNode.cpp b/dom/media/webaudio/AudioBufferSourceNode.cpp index 051f3c2381b4..18ff145b5426 100644 --- a/dom/media/webaudio/AudioBufferSourceNode.cpp +++ b/dom/media/webaudio/AudioBufferSourceNode.cpp @@ -55,7 +55,6 @@ class AudioBufferSourceNodeEngine final : public AudioNodeEngine { mBufferSampleRate(0), // mResamplerOutRate is initialized in UpdateResampler(). mChannels(0), - mDopplerShift(1.0f), mDestination(aDestination->Stream()), mPlaybackRateTimeline(1.0f), mDetuneTimeline(0.0f), @@ -102,9 +101,6 @@ class AudioBufferSourceNodeEngine final : public AudioNodeEngine { // Round to nearest mBeginProcessing = mStart + 0.5; break; - case AudioBufferSourceNode::DOPPLERSHIFT: - mDopplerShift = (aParam <= 0 || mozilla::IsNaN(aParam)) ? 1.0 : aParam; - break; default: NS_ERROR("Bad AudioBufferSourceNodeEngine double parameter."); }; @@ -441,10 +437,9 @@ class AudioBufferSourceNodeEngine final : public AudioNodeEngine { int32_t ComputeFinalOutSampleRate(float aPlaybackRate, float aDetune) { float computedPlaybackRate = aPlaybackRate * exp2(aDetune / 1200.f); - // Make sure the playback rate and the doppler shift are something - // our resampler can work with. + // Make sure the playback rate is something our resampler can work with. int32_t rate = WebAudioUtils::TruncateFloatToInt( - mSource->SampleRate() / (computedPlaybackRate * mDopplerShift)); + mSource->SampleRate() / computedPlaybackRate); return rate ? rate : mBufferSampleRate; } @@ -574,7 +569,6 @@ class AudioBufferSourceNodeEngine final : public AudioNodeEngine { int32_t mBufferSampleRate; int32_t mResamplerOutRate; uint32_t mChannels; - float mDopplerShift; RefPtr mDestination; // mSource deletes the engine in its destructor. @@ -814,11 +808,6 @@ void AudioBufferSourceNode::NotifyMainThreadStreamFinished() { MarkInactive(); } -void AudioBufferSourceNode::SendDopplerShiftToStream(double aDopplerShift) { - MOZ_ASSERT(mStream, "Should have disconnected panner if no stream"); - SendDoubleParameterToStream(DOPPLERSHIFT, aDopplerShift); -} - void AudioBufferSourceNode::SendLoopParametersToStream() { if (!mStream) { return; diff --git a/dom/media/webaudio/AudioBufferSourceNode.h b/dom/media/webaudio/AudioBufferSourceNode.h index e0fbe543b73a..23917b9215ce 100644 --- a/dom/media/webaudio/AudioBufferSourceNode.h +++ b/dom/media/webaudio/AudioBufferSourceNode.h @@ -69,8 +69,6 @@ class AudioBufferSourceNode final : public AudioScheduledSourceNode, mLoopEnd = aEnd; SendLoopParametersToStream(); } - void SendDopplerShiftToStream(double aDopplerShift); - void NotifyMainThreadStreamFinished() override; const char* NodeType() const override { return "AudioBufferSourceNode"; } @@ -101,8 +99,7 @@ class AudioBufferSourceNode final : public AudioScheduledSourceNode, LOOPSTART, LOOPEND, PLAYBACKRATE, - DETUNE, - DOPPLERSHIFT + DETUNE }; void SendLoopParametersToStream();