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

Unified Diff: Source/core/platform/audio/AudioFIFO.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/core/platform/audio/AudioFIFO.h ('k') | Source/core/platform/audio/AudioPullFIFO.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/audio/AudioFIFO.cpp
diff --git a/Source/core/platform/audio/AudioFIFO.cpp b/Source/core/platform/audio/AudioFIFO.cpp
index eb776985d6acb65b9368ddf00568bd9db8e5b45d..efa376731906e562a93433ba6c0daf55dd428428 100644
--- a/Source/core/platform/audio/AudioFIFO.cpp
+++ b/Source/core/platform/audio/AudioFIFO.cpp
@@ -35,7 +35,7 @@
namespace WebCore {
AudioFIFO::AudioFIFO(unsigned numberOfChannels, size_t fifoLength)
- : m_fifoAudioBus(numberOfChannels, fifoLength)
+ : m_fifoAudioBus(AudioBus::create(numberOfChannels, fifoLength))
, m_fifoLength(fifoLength)
, m_framesInFifo(0)
, m_readIndex(0)
@@ -56,11 +56,11 @@ void AudioFIFO::consume(AudioBus* destination, size_t framesToConsume)
size_t part2Length;
findWrapLengths(m_readIndex, framesToConsume, part1Length, part2Length);
- size_t numberOfChannels = m_fifoAudioBus.numberOfChannels();
+ size_t numberOfChannels = m_fifoAudioBus->numberOfChannels();
for (size_t channelIndex = 0; channelIndex < numberOfChannels; ++channelIndex) {
float* destinationData = destination->channel(channelIndex)->mutableData();
- const float* sourceData = m_fifoAudioBus.channel(channelIndex)->data();
+ const float* sourceData = m_fifoAudioBus->channel(channelIndex)->data();
bool isCopyGood = ((m_readIndex < m_fifoLength)
&& (m_readIndex + part1Length) <= m_fifoLength
@@ -93,10 +93,10 @@ void AudioFIFO::push(const AudioBus* sourceBus)
size_t part2Length;
findWrapLengths(m_writeIndex, sourceLength, part1Length, part2Length);
- size_t numberOfChannels = m_fifoAudioBus.numberOfChannels();
+ size_t numberOfChannels = m_fifoAudioBus->numberOfChannels();
for (size_t channelIndex = 0; channelIndex < numberOfChannels; ++channelIndex) {
- float* destination = m_fifoAudioBus.channel(channelIndex)->mutableData();
+ float* destination = m_fifoAudioBus->channel(channelIndex)->mutableData();
const float* source = sourceBus->channel(channelIndex)->data();
bool isCopyGood = ((m_writeIndex < m_fifoLength)
« no previous file with comments | « Source/core/platform/audio/AudioFIFO.h ('k') | Source/core/platform/audio/AudioPullFIFO.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698