Title: [273580] branches/safari-611-branch/Source/WebCore
- Revision
- 273580
- Author
- alanc...@apple.com
- Date
- 2021-02-26 12:27:14 -0800 (Fri, 26 Feb 2021)
Log Message
Cherry-pick r273558. rdar://problem/74800042
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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273558 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-611-branch/Source/WebCore/ChangeLog (273579 => 273580)
--- branches/safari-611-branch/Source/WebCore/ChangeLog 2021-02-26 20:27:10 UTC (rev 273579)
+++ branches/safari-611-branch/Source/WebCore/ChangeLog 2021-02-26 20:27:14 UTC (rev 273580)
@@ -1,5 +1,29 @@
2021-02-26 Alan Coon <alanc...@apple.com>
+ Cherry-pick r273558. rdar://problem/74800042
+
+ 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):
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273558 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2021-02-26 Chris Dumez <cdu...@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 Alan Coon <alanc...@apple.com>
+
Cherry-pick r273542. rdar://problem/74800042
Fix threading issue in ScriptProcessorNode::process()
Modified: branches/safari-611-branch/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp (273579 => 273580)
--- branches/safari-611-branch/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp 2021-02-26 20:27:10 UTC (rev 273579)
+++ branches/safari-611-branch/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp 2021-02-26 20:27:14 UTC (rev 273580)
@@ -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
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes