Title: [106332] trunk
- Revision
- 106332
- Author
- [email protected]
- Date
- 2012-01-30 21:47:29 -0800 (Mon, 30 Jan 2012)
Log Message
Fix ASSERT fail within AudioBus::processWithGainFrom()
https://bugs.webkit.org/show_bug.cgi?id=76685
Patch by Raymond Liu <[email protected]> on 2012-01-30
Reviewed by Daniel Bates.
Source/WebCore:
Test: webaudio/audionode-connect-order.html
* webaudio/AudioBasicProcessorNode.cpp:
(WebCore::AudioBasicProcessorNode::AudioBasicProcessorNode):
LayoutTests:
* webaudio/audionode-connect-order-expected.txt: Added.
* webaudio/audionode-connect-order.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (106331 => 106332)
--- trunk/LayoutTests/ChangeLog 2012-01-31 05:04:08 UTC (rev 106331)
+++ trunk/LayoutTests/ChangeLog 2012-01-31 05:47:29 UTC (rev 106332)
@@ -1,3 +1,13 @@
+2012-01-30 Raymond Liu <[email protected]>
+
+ Fix ASSERT fail within AudioBus::processWithGainFrom()
+ https://bugs.webkit.org/show_bug.cgi?id=76685
+
+ Reviewed by Daniel Bates.
+
+ * webaudio/audionode-connect-order-expected.txt: Added.
+ * webaudio/audionode-connect-order.html: Added.
+
2012-01-30 Roland Steiner <[email protected]>
<style scoped>: Implement scoped stylesheets and basic application
Added: trunk/LayoutTests/webaudio/audionode-connect-order-expected.txt (0 => 106332)
--- trunk/LayoutTests/webaudio/audionode-connect-order-expected.txt (rev 0)
+++ trunk/LayoutTests/webaudio/audionode-connect-order-expected.txt 2012-01-31 05:47:29 UTC (rev 106332)
@@ -0,0 +1,8 @@
+This tests that we don't trigger an assertion failure due to AudioNode connection order.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/webaudio/audionode-connect-order.html (0 => 106332)
--- trunk/LayoutTests/webaudio/audionode-connect-order.html (rev 0)
+++ trunk/LayoutTests/webaudio/audionode-connect-order.html 2012-01-31 05:47:29 UTC (rev 106332)
@@ -0,0 +1,73 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<script src=""
+</head>
+
+<body>
+
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+description("This tests that we don't trigger an assertion failure due to AudioNode connection order.");
+
+var sampleRate = 44100.0;
+var renderLengthSeconds = 0.125;
+var delayTimeSeconds = 0.1;
+
+function createSinWaveBuffer(context, lengthInSeconds, frequency) {
+ var audioBuffer = context.createBuffer(1, lengthInSeconds * sampleRate, sampleRate);
+
+ var n = audioBuffer.length;
+ var data = ""
+
+ for (var i = 0; i < n; ++i) {
+ data[i] = Math.sin(frequency * 2 * Math.PI * i / sampleRate);
+ }
+
+ return audioBuffer;
+}
+
+function runTest() {
+ if (window.layoutTestController) {
+ layoutTestController.overridePreference("WebKitWebAudioEnabled", "1");
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ window.jsTestIsAsync = true;
+
+ // Create offline audio context.
+ var context = new webkitAudioContext(1, sampleRate * renderLengthSeconds, sampleRate);
+ var toneBuffer = createSinWaveBuffer(context, renderLengthSeconds, 880);
+
+ var bufferSource = context.createBufferSource();
+ bufferSource.buffer = toneBuffer;
+ bufferSource.connect(context.destination);
+
+ var delay = context.createDelayNode();
+ delay.delayTime.value = delayTimeSeconds;
+
+ // We connect delay node to gain node before anything is connected to delay node itself.
+ // We do this because we try to trigger the ASSERT which might be fired due to AudioNode connection order,
+ // especially when gain node and delay node is involved e.g. https://bugs.webkit.org/show_bug.cgi?id=76685.
+
+ var gain = context.createGainNode();
+ gain.connect(context.destination);
+ delay.connect(gain);
+
+ bufferSource.noteOn(0);
+
+ context._oncomplete_ = finishJSTest;
+ context.startRendering();
+}
+
+runTest();
+
+</script>
+
+<script src=""
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (106331 => 106332)
--- trunk/Source/WebCore/ChangeLog 2012-01-31 05:04:08 UTC (rev 106331)
+++ trunk/Source/WebCore/ChangeLog 2012-01-31 05:47:29 UTC (rev 106332)
@@ -1,3 +1,15 @@
+2012-01-30 Raymond Liu <[email protected]>
+
+ Fix ASSERT fail within AudioBus::processWithGainFrom()
+ https://bugs.webkit.org/show_bug.cgi?id=76685
+
+ Reviewed by Daniel Bates.
+
+ Test: webaudio/audionode-connect-order.html
+
+ * webaudio/AudioBasicProcessorNode.cpp:
+ (WebCore::AudioBasicProcessorNode::AudioBasicProcessorNode):
+
2012-01-30 Roland Steiner <[email protected]>
<style scoped>: Implement scoped stylesheets and basic application
Modified: trunk/Source/WebCore/webaudio/AudioBasicProcessorNode.cpp (106331 => 106332)
--- trunk/Source/WebCore/webaudio/AudioBasicProcessorNode.cpp 2012-01-31 05:04:08 UTC (rev 106331)
+++ trunk/Source/WebCore/webaudio/AudioBasicProcessorNode.cpp 2012-01-31 05:47:29 UTC (rev 106332)
@@ -40,7 +40,7 @@
: AudioNode(context, sampleRate)
{
addInput(adoptPtr(new AudioNodeInput(this)));
- addOutput(adoptPtr(new AudioNodeOutput(this, 0)));
+ addOutput(adoptPtr(new AudioNodeOutput(this, 1)));
// The subclass must create m_processor.
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes