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

Side by Side 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: Remove workaround in scriptprocessornode test 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/modules/webaudio/AudioDestinationNode.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 13 matching lines...) Expand all
24 24
25 #include "config.h" 25 #include "config.h"
26 #if ENABLE(WEB_AUDIO) 26 #if ENABLE(WEB_AUDIO)
27 #include "modules/webaudio/AudioDestinationNode.h" 27 #include "modules/webaudio/AudioDestinationNode.h"
28 28
29 #include "modules/webaudio/AudioContext.h" 29 #include "modules/webaudio/AudioContext.h"
30 #include "modules/webaudio/AudioNodeInput.h" 30 #include "modules/webaudio/AudioNodeInput.h"
31 #include "modules/webaudio/AudioNodeOutput.h" 31 #include "modules/webaudio/AudioNodeOutput.h"
32 #include "platform/audio/AudioUtilities.h" 32 #include "platform/audio/AudioUtilities.h"
33 #include "platform/audio/DenormalDisabler.h" 33 #include "platform/audio/DenormalDisabler.h"
34 #include "wtf/Atomics.h"
34 35
35 namespace blink { 36 namespace blink {
36 37
37 AudioDestinationHandler::AudioDestinationHandler(AudioNode& node, float sampleRa te) 38 AudioDestinationHandler::AudioDestinationHandler(AudioNode& node, float sampleRa te)
38 : AudioHandler(NodeTypeDestination, node, sampleRate) 39 : AudioHandler(NodeTypeDestination, node, sampleRate)
39 , m_currentSampleFrame(0) 40 , m_currentSampleFrame(0)
40 { 41 {
41 addInput(); 42 addInput();
42 } 43 }
43 44
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 destinationBus->copyFrom(*renderedBus); 84 destinationBus->copyFrom(*renderedBus);
84 } 85 }
85 86
86 // Process nodes which need a little extra help because they are not connect ed to anything, but still need to process. 87 // Process nodes which need a little extra help because they are not connect ed to anything, but still need to process.
87 context()->deferredTaskHandler().processAutomaticPullNodes(numberOfFrames); 88 context()->deferredTaskHandler().processAutomaticPullNodes(numberOfFrames);
88 89
89 // Let the context take care of any business at the end of each render quant um. 90 // Let the context take care of any business at the end of each render quant um.
90 context()->handlePostRenderTasks(); 91 context()->handlePostRenderTasks();
91 92
92 // Advance current sample-frame. 93 // Advance current sample-frame.
93 m_currentSampleFrame += numberOfFrames; 94 size_t newSampleFrame = m_currentSampleFrame + numberOfFrames;
95 releaseStore(&m_currentSampleFrame, newSampleFrame);
94 } 96 }
95 97
96 // ---------------------------------------------------------------- 98 // ----------------------------------------------------------------
97 99
98 AudioDestinationNode::AudioDestinationNode(AudioContext& context) 100 AudioDestinationNode::AudioDestinationNode(AudioContext& context)
99 : AudioNode(context) 101 : AudioNode(context)
100 { 102 {
101 } 103 }
102 104
103 AudioDestinationHandler& AudioDestinationNode::audioDestinationHandler() const 105 AudioDestinationHandler& AudioDestinationNode::audioDestinationHandler() const
104 { 106 {
105 return static_cast<AudioDestinationHandler&>(handler()); 107 return static_cast<AudioDestinationHandler&>(handler());
106 } 108 }
107 109
108 unsigned long AudioDestinationNode::maxChannelCount() const 110 unsigned long AudioDestinationNode::maxChannelCount() const
109 { 111 {
110 return audioDestinationHandler().maxChannelCount(); 112 return audioDestinationHandler().maxChannelCount();
111 } 113 }
112 114
113 } // namespace blink 115 } // namespace blink
114 116
115 #endif // ENABLE(WEB_AUDIO) 117 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioDestinationNode.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698