Bug 878407 - Allocate a large enough delay buffer when the delay time fraction value is less than 0.5; r=roc

This commit is contained in:
Ehsan Akhgari 2013-06-02 09:25:46 -04:00
parent 7a83db0a0c
commit 20b20b238c
3 changed files with 13 additions and 1 deletions

View File

@ -0,0 +1,11 @@
<script>
o1 = new window.AudioContext();
o4 = o1.createDelay(0.4468);
o6 = o1.createPanner();
o7 = (function() {var buf = o1.createBuffer(1, 1000, o1.sampleRate);for(var j=0; j<1; ++j) {for(var i=0; i<1000; ++i) {buf.getChannelData(j)[i] = Math.sin(i * (-15));}}return buf;})();
o8 = o1.createBufferSource();
o8.buffer = o7;
o8.connect(o6);
o6.connect(o4)
o4.delayTime.setValueAtTime(0.6019893103749466289898, 0.26)
</script>

View File

@ -33,3 +33,4 @@ load 876252.html
load 876834.html
load 877820.html
load 878014.html
load 878407.html

View File

@ -116,7 +116,7 @@ public:
if (!mBuffer.SetLength(aNumberOfChannels)) {
return false;
}
const int32_t numFrames = NS_lround(mMaxDelay * aSampleRate);
const int32_t numFrames = ceil(mMaxDelay * aSampleRate);
for (uint32_t channel = 0; channel < aNumberOfChannels; ++channel) {
if (!mBuffer[channel].SetLength(numFrames)) {
return false;