bug 1199560 finish offline audio context processing even when allocation fails r=padenot

ProcessBlock() needs to return aFinished = true at some point.
This commit is contained in:
Karl Tomlinson 2015-08-24 19:29:15 +12:00
parent 97048994c0
commit b9dd91835e

View File

@ -66,21 +66,13 @@ public:
} }
// Handle the case of allocation failure in the input buffer // Handle the case of allocation failure in the input buffer
if (mBuffer) { uint32_t outputChannelCount = mBuffer ? mNumberOfChannels : 0;
return;
}
if (mWriteIndex >= mLength) {
NS_ASSERTION(mWriteIndex == mLength, "Overshot length");
// Don't record any more.
return;
}
// Record our input buffer // Record our input buffer
MOZ_ASSERT(mWriteIndex < mLength, "How did this happen?"); MOZ_ASSERT(mWriteIndex < mLength, "How did this happen?");
const uint32_t duration = std::min(WEBAUDIO_BLOCK_SIZE, mLength - mWriteIndex); const uint32_t duration = std::min(WEBAUDIO_BLOCK_SIZE, mLength - mWriteIndex);
const uint32_t inputChannelCount = aInput.mChannelData.Length(); const uint32_t inputChannelCount = aInput.mChannelData.Length();
for (uint32_t i = 0; i < mNumberOfChannels; ++i) { for (uint32_t i = 0; i < outputChannelCount; ++i) {
float* outputData = mBuffer->GetDataForWrite(i) + mWriteIndex; float* outputData = mBuffer->GetDataForWrite(i) + mWriteIndex;
if (aInput.IsNull() || i >= inputChannelCount) { if (aInput.IsNull() || i >= inputChannelCount) {
PodZero(outputData, duration); PodZero(outputData, duration);