mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 865234 - Part 5: Don't mark a stream as finished when there are streams following it; r=roc
Without this patch, if we have an AudioBufferSourceNode which is finished, the nodes following it will not see its mLastChunk. This breaks the Web Audio block processing logic since we rely on the assumption that the buffer for the last output of AudioBufferSourceNode is correctly passed to the following engines.
This commit is contained in:
parent
a61aa7a132
commit
1d867d0441
@ -353,6 +353,13 @@ AudioNodeStream::ObtainInputBlock(AudioChunk* aTmpChunk)
|
||||
void
|
||||
AudioNodeStream::ProduceOutput(GraphTime aFrom, GraphTime aTo)
|
||||
{
|
||||
if (mMarkAsFinishedAfterThisBlock) {
|
||||
// This stream was finished the last time that we looked at it, and all
|
||||
// of the depending streams have finished their output as well, so now
|
||||
// it's time to mark this stream as finished.
|
||||
FinishOutput();
|
||||
}
|
||||
|
||||
StreamBuffer::Track* track = EnsureTrack();
|
||||
|
||||
AudioChunk outputChunk;
|
||||
@ -369,7 +376,7 @@ AudioNodeStream::ProduceOutput(GraphTime aFrom, GraphTime aTo)
|
||||
bool finished = false;
|
||||
mEngine->ProduceAudioBlock(this, *inputChunk, &outputChunk, &finished);
|
||||
if (finished) {
|
||||
FinishOutput();
|
||||
mMarkAsFinishedAfterThisBlock = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,8 @@ public:
|
||||
: ProcessedMediaStream(nullptr),
|
||||
mEngine(aEngine),
|
||||
mKind(aKind),
|
||||
mNumberOfInputChannels(2)
|
||||
mNumberOfInputChannels(2),
|
||||
mMarkAsFinishedAfterThisBlock(false)
|
||||
{
|
||||
mMixingMode.mChannelCountMode = dom::ChannelCountMode::Max;
|
||||
mMixingMode.mChannelInterpretation = dom::ChannelInterpretation::Speakers;
|
||||
@ -108,6 +109,9 @@ protected:
|
||||
dom::ChannelCountMode mChannelCountMode : 16;
|
||||
dom::ChannelInterpretation mChannelInterpretation : 16;
|
||||
} mMixingMode;
|
||||
// Whether the stream should be marked as finished as soon
|
||||
// as the current time range has been computed block by block.
|
||||
bool mMarkAsFinishedAfterThisBlock;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user