b=989907 initialize AudioNodeExternalInputStream output chunk even when first track has null output r=roc

--HG--
extra : transplant_source : %96%C3%A3%DCs%D3%CCY6.%CC%07%22%02%EDy%A5%94U%DD
This commit is contained in:
Karl Tomlinson 2014-04-01 13:49:20 +13:00
Родитель 33827b3f7c
Коммит 69d7128f4d
1 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -437,17 +437,22 @@ AudioNodeExternalInputStream::ProcessInput(GraphTime aFrom, GraphTime aTo,
}
}
uint32_t accumulateIndex = 0;
if (inputChannels) {
AllocateAudioBlock(inputChannels, &mLastChunks[0]);
nsAutoTArray<float,GUESS_AUDIO_CHANNELS*WEBAUDIO_BLOCK_SIZE> downmixBuffer;
for (uint32_t i = 0; i < audioSegments.Length(); ++i) {
AudioChunk tmpChunk;
ConvertSegmentToAudioBlock(&audioSegments[i], &tmpChunk);
if (!tmpChunk.IsNull()) {
AccumulateInputChunk(i, tmpChunk, &mLastChunks[0], &downmixBuffer);
if (accumulateIndex == 0) {
AllocateAudioBlock(inputChannels, &mLastChunks[0]);
}
AccumulateInputChunk(accumulateIndex, tmpChunk, &mLastChunks[0], &downmixBuffer);
accumulateIndex++;
}
}
} else {
}
if (accumulateIndex == 0) {
mLastChunks[0].SetNull(WEBAUDIO_BLOCK_SIZE);
}
mCurrentOutputPosition += WEBAUDIO_BLOCK_SIZE;