bug 930257 finish BufferSource on processing last non-null block r=padenot

Since changes for bug 1217625, the node and downstream nodes won't be made
inactive until after downstream nodes have done their processing, and so there
is no need to wait for the first silent output block.

This essentially reverts 5c607f3f39d55544838f3111ede9e11a00d3c25e.

--HG--
extra : rebase_source : f449c427b580239f9072cc7c580585f10b69608f
This commit is contained in:
Karl Tomlinson 2015-10-23 08:55:57 +13:00
Родитель e2c3511d96
Коммит dc70c3e748
2 изменённых файлов: 8 добавлений и 13 удалений

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

@ -1,10 +1,7 @@
<!DOCTYPE html>
<html class="reftest-wait">
<script>
// Currently this test fails unless an extra block is processed after the
// BufferSource finishes. 12033 ≡ 1 (mod 128), but the test should pass even
// when only 12001 samples are processed.
var context = new window.OfflineAudioContext(1, 12033, 12000);
var context = new window.OfflineAudioContext(1, 12001, 12000);
var source = context.createBufferSource();
source.buffer = context.createBuffer(1, 12000, context.sampleRate);

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

@ -473,15 +473,6 @@ public:
}
StreamTime streamPosition = mDestination->GraphTimeToStreamTime(aFrom);
// We've finished if we've gone past mStop, or if we're past mDuration when
// looping is disabled.
if (streamPosition >= mStop ||
(!mLoop && mBufferPosition >= mBufferEnd && !mRemainingResamplerTail)) {
*aFinished = true;
aOutput->SetNull(WEBAUDIO_BLOCK_SIZE);
return;
}
uint32_t channels = mBuffer ? mBuffer->GetChannels() : 0;
UpdateSampleRateIfNeeded(channels, streamPosition);
@ -514,6 +505,13 @@ public:
}
}
}
// We've finished if we've gone past mStop, or if we're past mDuration when
// looping is disabled.
if (streamPosition >= mStop ||
(!mLoop && mBufferPosition >= mBufferEnd && !mRemainingResamplerTail)) {
*aFinished = true;
}
}
virtual bool IsActive() const override