b=923301 send only one release message when delay buffer is drained r=roc

--HG--
extra : transplant_source : %C7%8Ag%B2%C52X%A2%96%D1%8E%BB%15%E4%15%CC%1D%1Er%B8
This commit is contained in:
Karl Tomlinson 2013-10-25 12:12:13 +13:00
Родитель 748b20e3a4
Коммит a9d4f15ee6
1 изменённых файлов: 5 добавлений и 6 удалений

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

@ -92,18 +92,17 @@ public:
NS_DispatchToMainThread(refchanged);
}
mLeftOverData = mProcessor.MaxDelayFrames();
} else if (mLeftOverData != INT32_MIN) {
if (mLeftOverData <= 0) {
// Continue spamming the main thread with messages until we are destroyed.
// This isn't great.
mLeftOverData = 0;
} else if (mLeftOverData > 0) {
mLeftOverData -= WEBAUDIO_BLOCK_SIZE;
} else {
if (mLeftOverData != INT32_MIN) {
mLeftOverData = INT32_MIN;
playedBackAllLeftOvers = true;
nsRefPtr<PlayingRefChanged> refchanged =
new PlayingRefChanged(aStream, PlayingRefChanged::RELEASE);
NS_DispatchToMainThread(refchanged);
}
mLeftOverData -= WEBAUDIO_BLOCK_SIZE;
}
AllocateAudioBlock(numChannels, aOutput);