mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
b=967992 dispatch ended event, remove playing ref when source buffer is replaced with one shorter than offset r=padenot
Sending an updated BUFFEREND will stop playback appropriately. --HG-- extra : transplant_source : %17%81%5D%B5%CD%F1%7F%EC%23%28%F5D%E4oh%DB%9F%E7%210
This commit is contained in:
parent
eaca594bbb
commit
f1c8b044ec
@ -572,16 +572,6 @@ AudioBufferSourceNode::SendOffsetAndDurationParametersToStream(AudioNodeStream*
|
||||
int32_t bufferEnd = mBuffer->Length();
|
||||
int32_t offsetSamples = std::max(0, NS_lround(mOffset * rate));
|
||||
|
||||
if (offsetSamples >= bufferEnd) {
|
||||
// The offset falls past the end of the buffer. In this case, we need to
|
||||
// stop the playback immediately if it's in progress.
|
||||
// Note that we can't call Stop() here since that might be overridden if
|
||||
// web content calls Stop() too, so we just null out the buffer.
|
||||
if (mStartCalled) {
|
||||
aStream->SetBuffer(nullptr);
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Don't set parameter unnecessarily
|
||||
if (offsetSamples > 0) {
|
||||
aStream->SetInt32Parameter(BUFFERSTART, offsetSamples);
|
||||
|
Loading…
Reference in New Issue
Block a user