b=918213 dispatch onended from OscillatorNode even when stop time is before start r=ehsan

This makes OscillatorNode consistent with AudioBufferSourceNode

--HG--
extra : transplant_source : %AE8%3B%B4%E5M%60%03%CBN.%21%BD%FF%60%A6%F2a%BDi
This commit is contained in:
Karl Tomlinson 2013-09-24 13:48:35 +12:00
parent 0fa976d665
commit 41f2afcff3
3 changed files with 21 additions and 5 deletions

View File

@ -57,3 +57,4 @@ load 907986-3.html
load 907986-4.html
load 910171-1.html
load oscillator-ended-1.html
load oscillator-ended-2.html

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html class="reftest-wait">
<script>
function createContext() {
var context = new window.AudioContext();
var source = context.createOscillator();
source.onended = function(e) {
document.documentElement.removeAttribute("class");
};
source.connect(context.destination);
source.start(60);
source.stop(0.5);
}
createContext();
</script>

View File

@ -424,17 +424,17 @@ public:
return;
}
if (ticks + WEBAUDIO_BLOCK_SIZE < mStart) {
// We're not playing yet.
ComputeSilence(aOutput);
return;
}
if (ticks >= mStop) {
// We've finished playing.
ComputeSilence(aOutput);
*aFinished = true;
return;
}
if (ticks + WEBAUDIO_BLOCK_SIZE < mStart) {
// We're not playing yet.
ComputeSilence(aOutput);
return;
}
AllocateAudioBlock(1, aOutput);
float* output = static_cast<float*>(