Bug 1276483 - Fix WaveShaper when connected from a silent GainNode; r?padenot
MozReview-Commit-ID: 45ORsNZCkm5
--- a/dom/media/webaudio/GainNode.cpp
+++ b/dom/media/webaudio/GainNode.cpp
@@ -61,22 +61,18 @@ public:
bool* aFinished) override
{
if (aInput.IsNull()) {
// If input is silent, so is the output
aOutput->SetNull(WEBAUDIO_BLOCK_SIZE);
} else if (mGain.HasSimpleValue()) {
// Optimize the case where we only have a single value set as the volume
float gain = mGain.GetValue();
- if (gain == 0.0f) {
- aOutput->SetNull(WEBAUDIO_BLOCK_SIZE);
- } else {
- *aOutput = aInput;
- aOutput->mVolume *= gain;
- }
+ *aOutput = aInput;
+ aOutput->mVolume *= gain;
} else {
// First, compute a vector of gains for each track tick based on the
// timeline at hand, and then for each channel, multiply the values
// in the buffer with the gain vector.
aOutput->AllocateChannels(aInput.ChannelCount());
// Compute the gain values for the duration of the input AudioChunk
StreamTime tick = mDestination->GraphTimeToStreamTime(aFrom);