diff --git a/content/media/webaudio/AudioParam.h b/content/media/webaudio/AudioParam.h index a9918d9073ec..da826a30c07f 100644 --- a/content/media/webaudio/AudioParam.h +++ b/content/media/webaudio/AudioParam.h @@ -64,6 +64,10 @@ public: // sure that the callback is called every time that this object gets mutated. void SetValue(float aValue) { + // Optimize away setting the same value on an AudioParam + if (HasSimpleValue() && fabsf(GetValue() - aValue) < 1e-7) { + return; + } AudioParamTimeline::SetValue(aValue); mCallback(mNode); }