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

Unified Diff: Source/modules/webaudio/ConvolverNode.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/AudioParam.cpp ('k') | Source/modules/webaudio/MediaStreamAudioDestinationNode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/ConvolverNode.cpp
diff --git a/Source/modules/webaudio/ConvolverNode.cpp b/Source/modules/webaudio/ConvolverNode.cpp
index dd4aa6f4dc2fe4a0408fc899974bc7a14bfbe01f..a48bd637b85e3891ccbcaf2d60143c2b1994ab28 100644
--- a/Source/modules/webaudio/ConvolverNode.cpp
+++ b/Source/modules/webaudio/ConvolverNode.cpp
@@ -132,15 +132,15 @@ void ConvolverNode::setBuffer(AudioBuffer* buffer)
// Wrap the AudioBuffer by an AudioBus. It's an efficient pointer set and not a memcpy().
// This memory is simply used in the Reverb constructor and no reference to it is kept for later use in that class.
- AudioBus bufferBus(numberOfChannels, bufferLength, false);
+ RefPtr<AudioBus> bufferBus = AudioBus::create(numberOfChannels, bufferLength, false);
for (unsigned i = 0; i < numberOfChannels; ++i)
- bufferBus.setChannelMemory(i, buffer->getChannelData(i)->data(), bufferLength);
+ bufferBus->setChannelMemory(i, buffer->getChannelData(i)->data(), bufferLength);
- bufferBus.setSampleRate(buffer->sampleRate());
+ bufferBus->setSampleRate(buffer->sampleRate());
// Create the reverb with the given impulse response.
bool useBackgroundThreads = !context()->isOfflineContext();
- OwnPtr<Reverb> reverb = adoptPtr(new Reverb(&bufferBus, AudioNode::ProcessingSizeInFrames, MaxFFTSize, 2, useBackgroundThreads, m_normalize));
+ OwnPtr<Reverb> reverb = adoptPtr(new Reverb(bufferBus.get(), AudioNode::ProcessingSizeInFrames, MaxFFTSize, 2, useBackgroundThreads, m_normalize));
{
// Synchronize with process().
« no previous file with comments | « Source/modules/webaudio/AudioParam.cpp ('k') | Source/modules/webaudio/MediaStreamAudioDestinationNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698