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

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

Issue 543073004: Defer changes to the channel count mode to the pre or post-render phase (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add ASSERT Created 6 years, 3 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/AudioNode.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/AudioNode.cpp
diff --git a/Source/modules/webaudio/AudioNode.cpp b/Source/modules/webaudio/AudioNode.cpp
index a2b4a76cfefbb5f28a2b968ab16f72d2207b8f10..4aaecf798847dff9faf97f2ecd25118aa8cf553a 100644
--- a/Source/modules/webaudio/AudioNode.cpp
+++ b/Source/modules/webaudio/AudioNode.cpp
@@ -54,6 +54,7 @@ AudioNode::AudioNode(AudioContext* context, float sampleRate)
, m_lastNonSilentTime(-1)
, m_connectionRefCount(0)
, m_isDisabled(false)
+ , m_newChannelCountMode(Max)
, m_channelCount(2)
, m_channelCountMode(Max)
, m_channelInterpretation(AudioBus::Speakers)
@@ -93,6 +94,7 @@ void AudioNode::dispose()
ASSERT(isMainThread());
ASSERT(context()->isGraphOwner());
+ context()->removeChangedChannelCountMode(this);
context()->removeAutomaticPullNode(this);
context()->disposeOutputs(*this);
for (unsigned i = 0; i < m_outputs.size(); ++i)
@@ -309,17 +311,17 @@ void AudioNode::setChannelCountMode(const String& mode, ExceptionState& exceptio
ChannelCountMode oldMode = m_channelCountMode;
if (mode == "max") {
- m_channelCountMode = Max;
+ m_newChannelCountMode = Max;
} else if (mode == "clamped-max") {
- m_channelCountMode = ClampedMax;
+ m_newChannelCountMode = ClampedMax;
} else if (mode == "explicit") {
- m_channelCountMode = Explicit;
+ m_newChannelCountMode = Explicit;
} else {
ASSERT_NOT_REACHED();
}
- if (m_channelCountMode != oldMode)
- updateChannelsForInputs();
+ if (m_newChannelCountMode != oldMode)
+ context()->addChangedChannelCountMode(this);
}
String AudioNode::channelInterpretation()
@@ -551,6 +553,12 @@ void AudioNode::trace(Visitor* visitor)
EventTargetWithInlineData::trace(visitor);
}
+void AudioNode::updateChannelCountMode()
+{
+ m_channelCountMode = m_newChannelCountMode;
+ updateChannelsForInputs();
+}
+
} // namespace blink
#endif // ENABLE(WEB_AUDIO)
« no previous file with comments | « Source/modules/webaudio/AudioNode.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698