Skip to content
Permalink
Browse files
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):

Canonical link: https://commits.webkit.org/234618@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273558 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
cdumez committed Feb 26, 2021
1 parent dc151fa commit 310d37dcad58cda468c073d4363d1f20433df85a
Showing 2 changed files with 14 additions and 3 deletions.
@@ -1,3 +1,13 @@
2021-02-26 Chris Dumez <cdumez@apple.com>

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 <zalan@apple.com>

[LFC][IFC] Inline boxes should not be referred as inline containers
@@ -118,7 +118,7 @@ RefPtr<AudioBuffer> ScriptProcessorNode::createInputBufferForJS(AudioBuffer* inp
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 @@ void ScriptProcessorNode::process(size_t framesToProcess)
{
// 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();

0 comments on commit 310d37d

Please sign in to comment.