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:
Karl Tomlinson 2014-02-06 08:30:49 +13:00
parent eaca594bbb
commit f1c8b044ec

View File

@ -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);