Bug 890023 - Set the output channel count for ConvolverNode to 2 unconditionally; r=roc

This commit is contained in:
Ehsan Akhgari 2013-07-04 09:22:22 -04:00
parent 75ac2d35d5
commit 3e21182565

View File

@ -116,24 +116,21 @@ public:
}
mSeenInput = true;
uint32_t numChannels = 2;
AudioChunk input = aInput;
if (aInput.IsNull()) {
AllocateAudioBlock(1, &input);
WriteZeroesToAudioBlock(&input, 0, WEBAUDIO_BLOCK_SIZE);
} else if (aInput.mVolume != 1.0f) {
// Pre-multiply the input's volume
numChannels = aInput.mChannelData.Length();
uint32_t numChannels = aInput.mChannelData.Length();
AllocateAudioBlock(numChannels, &input);
for (uint32_t i = 0; i < numChannels; ++i) {
const float* src = static_cast<const float*>(aInput.mChannelData[i]);
float* dest = static_cast<float*>(const_cast<void*>(input.mChannelData[i]));
AudioBlockAddChannelWithScale(src, aInput.mVolume, dest);
}
} else {
numChannels = aInput.mChannelData.Length();
}
AllocateAudioBlock(numChannels, aOutput);
AllocateAudioBlock(2, aOutput);
mReverb->process(&input, aOutput, WEBAUDIO_BLOCK_SIZE);
}