b=910171 register tail references with the AudioContext so they can be removed when the rendering is complete r=ehsan

--HG--
extra : transplant_source : %8C%C3%C2%2B%1B%E9Q%9B%0E%DE%B4%AA%02%B2%D1%A0S%F1%EC%0D
This commit is contained in:
Karl Tomlinson 2013-09-17 11:54:52 +12:00
parent 608b070c45
commit 9a843336e3
6 changed files with 24 additions and 11 deletions

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html class="reftest-wait">
<script>
var context = new window.OfflineAudioContext(1, 4096, 48000);
context.oncomplete = function(e) {
document.documentElement.removeAttribute("class");
};
var delay = context.createDelay();
delay.connect(context.destination);
delay.delayTime.value = 1.0;
var buffer = context.createBuffer(1, 2048, context.sampleRate);
var source = context.createBufferSource();
source.buffer = buffer;
source.connect(delay);
source.start();
context.startRendering();
</script>

View File

@ -55,3 +55,4 @@ load 907986-1.html
load 907986-2.html
load 907986-3.html
load 907986-4.html
load 910171-1.html

View File

@ -63,18 +63,15 @@ public:
}
bool AcceptPlayingRefRelease(int64_t aLastGraphUpdateIndexProcessed) const
{
// Reject any requests to release mPlayingRef if the request was issued
// Reject any requests to release the playing ref if the request was issued
// before the MediaStreamGraph was aware of the most-recently-added input
// connection.
return aLastGraphUpdateIndexProcessed >= mMediaStreamGraphUpdateIndexAtLastInputConnection;
}
private:
friend class PlayingRefChangeHandler<ConvolverNode>;
int64_t mMediaStreamGraphUpdateIndexAtLastInputConnection;
nsRefPtr<AudioBuffer> mBuffer;
SelfReference<ConvolverNode> mPlayingRef;
bool mNormalize;
};

View File

@ -39,7 +39,7 @@ public:
}
bool AcceptPlayingRefRelease(int64_t aLastGraphUpdateIndexProcessed) const
{
// Reject any requests to release mPlayingRef if the request was issued
// Reject any requests to release the playing ref if the request was issued
// before the MediaStreamGraph was aware of the most-recently-added input
// connection.
return aLastGraphUpdateIndexProcessed >= mMediaStreamGraphUpdateIndexAtLastInputConnection;
@ -48,12 +48,10 @@ public:
private:
static void SendDelayToStream(AudioNode* aNode);
friend class DelayNodeEngine;
friend class PlayingRefChangeHandler<DelayNode>;
private:
int64_t mMediaStreamGraphUpdateIndexAtLastInputConnection;
nsRefPtr<AudioParam> mDelay;
SelfReference<DelayNode> mPlayingRef;
};
}

View File

@ -38,10 +38,10 @@ public:
}
if (node) {
if (mChange == ADDREF) {
node->mPlayingRef.Take(node);
node->MarkActive();
} else if (mChange == RELEASE &&
node->AcceptPlayingRefRelease(mLastProcessedGraphUpdateIndex)) {
node->mPlayingRef.Drop(node);
node->MarkInactive();
}
}
return NS_OK;

View File

@ -1,7 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test PannerNode directly above</title>
<title>Test ConvolverNode channel count</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
@ -12,7 +12,7 @@
const signalLength = 2048;
const responseLength = 1000;
const outputLength = 4096; // > signalLength + responseLength to work around bug 910171
const outputLength = 2048; // < signalLength + responseLength to test bug 910171
var gTest = {
length: outputLength,