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

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

Issue 1149913002: Access current frame counter carefully and remove m_cachedSampleFrame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
Index: Source/modules/webaudio/AudioDestinationNode.cpp
diff --git a/Source/modules/webaudio/AudioDestinationNode.cpp b/Source/modules/webaudio/AudioDestinationNode.cpp
index 538a366a9c16e6424baac2ee29d0c6c9190e4e4e..b061e8a81e5f35055a1c7a9d6a8ffd24094fd8ce 100644
--- a/Source/modules/webaudio/AudioDestinationNode.cpp
+++ b/Source/modules/webaudio/AudioDestinationNode.cpp
@@ -31,6 +31,7 @@
#include "modules/webaudio/AudioNodeOutput.h"
#include "platform/audio/AudioUtilities.h"
#include "platform/audio/DenormalDisabler.h"
+#include "wtf/Atomics.h"
namespace blink {
@@ -90,7 +91,7 @@ void AudioDestinationHandler::render(AudioBus* sourceBus, AudioBus* destinationB
context()->handlePostRenderTasks();
// Advance current sample-frame.
- m_currentSampleFrame += numberOfFrames;
+ atomicAdd(&m_currentSampleFrame, numberOfFrames);
tkent 2015/05/22 00:47:12 I don't think using atomicAdd() here is correct. a
Raymond Toy 2015/05/22 16:13:48 Done. Thanks for the hint.
}
// ----------------------------------------------------------------
« Source/modules/webaudio/AudioContext.h ('K') | « Source/modules/webaudio/AudioContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698