Title: [273558] trunk/Source/WebCore
Revision
273558
Author
[email protected]
Date
2021-02-26 08:02:34 -0800 (Fri, 26 Feb 2021)

Log Message

Unreviewed, address post-landing review feedback for r273542.

Update a comment and fix a check that was reversed.

* Modules/webaudio/ScriptProcessorNode.cpp:
(WebCore::ScriptProcessorNode::createOutputBufferForJS const):
(WebCore::ScriptProcessorNode::process):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (273557 => 273558)


--- trunk/Source/WebCore/ChangeLog	2021-02-26 15:46:58 UTC (rev 273557)
+++ trunk/Source/WebCore/ChangeLog	2021-02-26 16:02:34 UTC (rev 273558)
@@ -1,3 +1,13 @@
+2021-02-26  Chris Dumez  <[email protected]>
+
+        Unreviewed, address post-landing review feedback for r273542.
+
+        Update a comment and fix a check that was reversed.
+
+        * Modules/webaudio/ScriptProcessorNode.cpp:
+        (WebCore::ScriptProcessorNode::createOutputBufferForJS const):
+        (WebCore::ScriptProcessorNode::process):
+
 2021-02-26  Zalan Bujtas  <[email protected]>
 
         [LFC][IFC] Inline boxes should not be referred as inline containers

Modified: trunk/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp (273557 => 273558)


--- trunk/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp	2021-02-26 15:46:58 UTC (rev 273557)
+++ trunk/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp	2021-02-26 16:02:34 UTC (rev 273558)
@@ -118,7 +118,7 @@
 RefPtr<AudioBuffer> ScriptProcessorNode::createOutputBufferForJS(AudioBuffer& outputBuffer) const
 {
     // As an optimization, we reuse the same buffer as last time when possible.
-    if (!m_cachedOutputBufferForJS || m_cachedOutputBufferForJS->topologyMatches(outputBuffer))
+    if (!m_cachedOutputBufferForJS || !m_cachedOutputBufferForJS->topologyMatches(outputBuffer))
         m_cachedOutputBufferForJS = outputBuffer.clone(AudioBuffer::ShouldCopyChannelData::No);
     else
         m_cachedOutputBufferForJS->zero();
@@ -148,9 +148,10 @@
 {
     // Discussion about inputs and outputs:
     // As in other AudioNodes, ScriptProcessorNode uses an AudioBus for its input and output (see inputBus and outputBus below).
-    // Additionally, there is a double-buffering for input and output which is exposed directly to _javascript_ (see inputBuffer and outputBuffer below).
+    // Additionally, there is a double-buffering for input and output (see inputBuffer and outputBuffer below).
     // This node is the producer for inputBuffer and the consumer for outputBuffer.
-    // The _javascript_ code is the consumer of inputBuffer and the producer for outputBuffer.
+    // The _javascript_ code is the consumer of inputBuffer and the producer for outputBuffer. The _javascript_ gets its own copy
+    // of the buffers for safety reasons.
 
     // Get input and output busses.
     AudioBus* inputBus = this->input(0)->bus();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to