Title: [193732] branches/safari-601-branch

Diff

Modified: branches/safari-601-branch/LayoutTests/ChangeLog (193731 => 193732)


--- branches/safari-601-branch/LayoutTests/ChangeLog	2015-12-08 08:45:47 UTC (rev 193731)
+++ branches/safari-601-branch/LayoutTests/ChangeLog	2015-12-08 08:47:28 UTC (rev 193732)
@@ -1,3 +1,21 @@
+2015-12-08  Babak Shafiei  <bshaf...@apple.com>
+
+        Merge r192281.
+
+    2015-11-10  Brent Fulgham  <bfulg...@apple.com>
+
+            Crash running webaudio/panner-loop.html
+            https://bugs.webkit.org/show_bug.cgi?id=150200
+            <rdar://problem/23136282>
+
+            Reviewed by Jer Noble.
+
+            This is based on the changes in Blink r164822:
+            https://codereview.chromium.org/130003002
+
+            * webaudio/panner-loop-expected.txt: Added.
+            * webaudio/panner-loop.html: Added.
+
 2015-12-02  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         Unify font-variant-* with font-variant shorthand

Copied: branches/safari-601-branch/LayoutTests/webaudio/panner-loop-expected.txt (from rev 193703, branches/safari-601.1.46.60-branch/LayoutTests/webaudio/panner-loop-expected.txt) (0 => 193732)


--- branches/safari-601-branch/LayoutTests/webaudio/panner-loop-expected.txt	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/webaudio/panner-loop-expected.txt	2015-12-08 08:47:28 UTC (rev 193732)
@@ -0,0 +1,9 @@
+Test PannerNode handling of feedback loops
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+PASS Rendering successfully completed.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: branches/safari-601-branch/LayoutTests/webaudio/panner-loop.html (from rev 193703, branches/safari-601.1.46.60-branch/LayoutTests/webaudio/panner-loop.html) (0 => 193732)


--- branches/safari-601-branch/LayoutTests/webaudio/panner-loop.html	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/webaudio/panner-loop.html	2015-12-08 08:47:28 UTC (rev 193732)
@@ -0,0 +1,84 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <script src=""
+    <script src=""
+    <script src=""
+  </head>
+
+  <body>
+    <div id="description"></div>
+    <div id="console"></div>
+    <script>
+      description("Test PannerNode handling of feedback loops");
+
+      // See webkit.org/b/150200
+      // See crbug.com/331446.
+
+      // Create a simple feedback loop and make sure the panner node processes it correctly.
+
+      function runTest() {
+          if (window.testRunner) {
+              testRunner.dumpAsText();
+              testRunner.waitUntilDone();
+          }
+
+          window.jsTestIsAsync = true;
+
+          var sampleRate = 44100;
+          var renderLengthSeconds = 1;
+      
+          // Create offline audio context.
+          var context = new webkitOfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate);
+
+          // Create nodes in graph. This is based on the test given in crbug.com/331446.
+          var source = context.createBufferSource();
+          source.buffer = createImpulseBuffer(context, sampleRate * renderLengthSeconds);
+          var activateNode = context.createGain();
+          var dry = context.createGain();
+          var wet = context.createGain();
+          var filter = context.createBiquadFilter();
+          var delay = context.createDelay();
+          var feedbackNode = context.createGain();
+          var output = context.createGain();
+
+          delay.delayTime.value = 0.1;
+          wet.gain.value = 0.5;
+          dry.gain.value = 1;
+          feedbackNode.gain.value = 0.45;
+          filter.frequency.value = 20000;
+
+          source.connect(activateNode);
+          activateNode.connect(delay);
+          activateNode.connect(dry);
+          delay.connect(filter);
+          filter.connect(feedbackNode);
+          feedbackNode.connect(delay);
+          feedbackNode.connect(wet);
+          wet.connect(output);
+          dry.connect(output);
+
+          var panner = context.createPanner();
+          panner.coneOuterGain = 0.1;
+          panner.coneOuterAngle = 180;
+          panner.coneInnerAngle = 0;
+
+          panner.connect(context.destination);
+
+          output.connect(panner);
+
+          // Render.  We don't care what the output is, though.
+
+          context._oncomplete_ = function (event) {
+                                   testPassed("Rendering successfully completed.");
+                                   finishJSTest();
+                               };
+          context.startRendering();
+      }
+      
+      runTest();
+      successfullyParsed = true;
+    </script>
+    
+  </body>
+</html>

Modified: branches/safari-601-branch/Source/WebCore/ChangeLog (193731 => 193732)


--- branches/safari-601-branch/Source/WebCore/ChangeLog	2015-12-08 08:45:47 UTC (rev 193731)
+++ branches/safari-601-branch/Source/WebCore/ChangeLog	2015-12-08 08:47:28 UTC (rev 193732)
@@ -1,3 +1,31 @@
+2015-12-08  Babak Shafiei  <bshaf...@apple.com>
+
+        Merge r192281.
+
+    2015-11-10  Brent Fulgham  <bfulg...@apple.com>
+
+            Crash running webaudio/panner-loop.html
+            https://bugs.webkit.org/show_bug.cgi?id=150200
+            <rdar://problem/23136282>
+
+            Reviewed by Jer Noble.
+
+            Test: webaudio/panner-loop.html
+
+            This is based on the changes in Blink r164822:
+            https://codereview.chromium.org/130003002
+
+            Avoid infinitely recursing on audio nodes by keeping track of which nodes we've already
+            visited.
+
+            * Modules/webaudio/PannerNode.cpp:
+            (WebCore::PannerNode::pullInputs): Pass set of visited nodes so we don't revisit
+            nodes we've already serviced.
+            (WebCore::PannerNode::notifyAudioSourcesConnectedToNode): Accept visitedNodes argument
+            so we can avoid revisiting nodes. Check if the current node has already been visited
+            before processing it.
+            * Modules/webaudio/PannerNode.h:
+
 2015-12-02  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         Unify font-variant-* with font-variant shorthand

Modified: branches/safari-601-branch/Source/WebCore/Modules/webaudio/PannerNode.cpp (193731 => 193732)


--- branches/safari-601-branch/Source/WebCore/Modules/webaudio/PannerNode.cpp	2015-12-08 08:45:47 UTC (rev 193731)
+++ branches/safari-601-branch/Source/WebCore/Modules/webaudio/PannerNode.cpp	2015-12-08 08:47:28 UTC (rev 193732)
@@ -88,7 +88,8 @@
         m_connectionCount = context()->connectionCount();
 
         // Recursively go through all nodes connected to us.
-        notifyAudioSourcesConnectedToNode(this);
+        HashSet<AudioNode*> visitedNodes;
+        notifyAudioSourcesConnectedToNode(this, visitedNodes);
     }
     
     AudioNode::pullInputs(framesToProcess);
@@ -397,7 +398,7 @@
     return float(distanceGain * coneGain);
 }
 
-void PannerNode::notifyAudioSourcesConnectedToNode(AudioNode* node)
+void PannerNode::notifyAudioSourcesConnectedToNode(AudioNode* node, HashSet<AudioNode*>& visitedNodes)
 {
     ASSERT(node);
     if (!node)
@@ -416,7 +417,11 @@
             for (unsigned j = 0; j < input->numberOfRenderingConnections(); ++j) {
                 AudioNodeOutput* connectedOutput = input->renderingOutput(j);
                 AudioNode* connectedNode = connectedOutput->node();
-                notifyAudioSourcesConnectedToNode(connectedNode); // recurse
+                if (visitedNodes.contains(connectedNode))
+                    continue;
+
+                visitedNodes.add(connectedNode);
+                notifyAudioSourcesConnectedToNode(connectedNode, visitedNodes);
             }
         }
     }

Modified: branches/safari-601-branch/Source/WebCore/Modules/webaudio/PannerNode.h (193731 => 193732)


--- branches/safari-601-branch/Source/WebCore/Modules/webaudio/PannerNode.h	2015-12-08 08:45:47 UTC (rev 193731)
+++ branches/safari-601-branch/Source/WebCore/Modules/webaudio/PannerNode.h	2015-12-08 08:47:28 UTC (rev 193732)
@@ -36,6 +36,7 @@
 #include "Panner.h"
 #include <memory>
 #include <mutex>
+#include <wtf/HashSet.h>
 
 namespace WebCore {
 
@@ -139,7 +140,7 @@
 
     // Notifies any AudioBufferSourceNodes connected to us either directly or indirectly about our existence.
     // This is in order to handle the pitch change necessary for the doppler shift.
-    void notifyAudioSourcesConnectedToNode(AudioNode*);
+    void notifyAudioSourcesConnectedToNode(AudioNode*, HashSet<AudioNode*>& visitedNodes);
 
     std::unique_ptr<Panner> m_panner;
     unsigned m_panningModel;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to