Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Unified Diff: Source/modules/webaudio/ScriptProcessorNode.cpp

Issue 14628008: Require use of AudioBus::create() to avoid ref-counting issues (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Require use of Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/webaudio/ScriptProcessorNode.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/ScriptProcessorNode.cpp
diff --git a/Source/modules/webaudio/ScriptProcessorNode.cpp b/Source/modules/webaudio/ScriptProcessorNode.cpp
index 41c1f13f7927b39629d0f837cb9794acf676954c..5dc1204ff5b64c3db3de07c6e152d4f69ee33ae8 100644
--- a/Source/modules/webaudio/ScriptProcessorNode.cpp
+++ b/Source/modules/webaudio/ScriptProcessorNode.cpp
@@ -79,7 +79,7 @@ ScriptProcessorNode::ScriptProcessorNode(AudioContext* context, float sampleRate
, m_isRequestOutstanding(false)
, m_numberOfInputChannels(numberOfInputChannels)
, m_numberOfOutputChannels(numberOfOutputChannels)
- , m_internalInputBus(numberOfInputChannels, AudioNode::ProcessingSizeInFrames, false)
+ , m_internalInputBus(AudioBus::create(numberOfInputChannels, AudioNode::ProcessingSizeInFrames, false))
{
// Regardless of the allowed buffer sizes, we still need to process at the granularity of the AudioNode.
if (m_bufferSize < AudioNode::ProcessingSizeInFrames)
@@ -154,11 +154,11 @@ void ScriptProcessorNode::process(size_t framesToProcess)
AudioBuffer* outputBuffer = m_outputBuffers[doubleBufferIndex].get();
// Check the consistency of input and output buffers.
- unsigned numberOfInputChannels = m_internalInputBus.numberOfChannels();
+ unsigned numberOfInputChannels = m_internalInputBus->numberOfChannels();
bool buffersAreGood = outputBuffer && bufferSize() == outputBuffer->length() && m_bufferReadWriteIndex + framesToProcess <= bufferSize();
// If the number of input channels is zero, it's ok to have inputBuffer = 0.
- if (m_internalInputBus.numberOfChannels())
+ if (m_internalInputBus->numberOfChannels())
buffersAreGood = buffersAreGood && inputBuffer && bufferSize() == inputBuffer->length();
ASSERT(buffersAreGood);
@@ -179,10 +179,10 @@ void ScriptProcessorNode::process(size_t framesToProcess)
return;
for (unsigned i = 0; i < numberOfInputChannels; i++)
- m_internalInputBus.setChannelMemory(i, inputBuffer->getChannelData(i)->data() + m_bufferReadWriteIndex, framesToProcess);
+ m_internalInputBus->setChannelMemory(i, inputBuffer->getChannelData(i)->data() + m_bufferReadWriteIndex, framesToProcess);
if (numberOfInputChannels)
- m_internalInputBus.copyFrom(*inputBus);
+ m_internalInputBus->copyFrom(*inputBus);
// Copy from the output buffer to the output.
for (unsigned i = 0; i < numberOfOutputChannels; ++i)
« no previous file with comments | « Source/modules/webaudio/ScriptProcessorNode.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698