mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 1205540 don't send more null chunks than necessary to AnalyserNode r=padenot
This commit is contained in:
parent
8e55a0c90d
commit
9fc74a7d4a
@ -65,6 +65,19 @@ public:
|
||||
{
|
||||
*aOutput = aInput;
|
||||
|
||||
if (aInput.IsNull()) {
|
||||
// If AnalyserNode::mChunks has only null chunks, then there is no need
|
||||
// to send further null chunks.
|
||||
if (mChunksToProcess == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
--mChunksToProcess;
|
||||
} else {
|
||||
// This many null chunks will be required to empty AnalyserNode::mChunks.
|
||||
mChunksToProcess = CHUNK_COUNT;
|
||||
}
|
||||
|
||||
nsRefPtr<TransferBuffer> transfer =
|
||||
new TransferBuffer(aStream, aInput.AsAudioChunk());
|
||||
NS_DispatchToMainThread(transfer);
|
||||
@ -74,6 +87,8 @@ public:
|
||||
{
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
size_t mChunksToProcess = 0;
|
||||
};
|
||||
|
||||
AnalyserNode::AnalyserNode(AudioContext* aContext)
|
||||
|
Loading…
Reference in New Issue
Block a user