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

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

Issue 2014343002: Defer changes to channelInterpretation to pre/post rendering. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: third_party/WebKit/Source/modules/webaudio/AudioNode.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp b/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp
index 0e2320464e1b59c949d2bde59063b9e4e3f17f1f..bc6ccd61fe8dff82812cb360b1ded537322e0111 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp
@@ -97,6 +97,7 @@ void AudioHandler::dispose()
ASSERT(context()->isGraphOwner());
context()->deferredTaskHandler().removeChangedChannelCountMode(this);
+ context()->deferredTaskHandler().removeChangedChannelInterpretation(this);
context()->deferredTaskHandler().removeAutomaticPullNode(this);
for (auto& output : m_outputs)
output->dispose();
@@ -280,13 +281,18 @@ void AudioHandler::setChannelInterpretation(const String& interpretation, Except
ASSERT(isMainThread());
AbstractAudioContext::AutoLocker locker(context());
+ AudioBus::ChannelInterpretation oldMode = m_channelInterpretation;
+
if (interpretation == "speakers") {
- m_channelInterpretation = AudioBus::Speakers;
+ m_newChannelInterpretation = AudioBus::Speakers;
} else if (interpretation == "discrete") {
- m_channelInterpretation = AudioBus::Discrete;
+ m_newChannelInterpretation = AudioBus::Discrete;
} else {
ASSERT_NOT_REACHED();
}
+
+ if (m_newChannelInterpretation != oldMode)
+ context()->deferredTaskHandler().addChangedChannelInterpretation(this);
}
void AudioHandler::updateChannelsForInputs()
@@ -506,6 +512,11 @@ void AudioHandler::updateChannelCountMode()
updateChannelsForInputs();
}
+void AudioHandler::updateChannelInterpretation()
+{
+ m_channelInterpretation = m_newChannelInterpretation;
+}
+
unsigned AudioHandler::numberOfOutputChannels() const
{
// This should only be called for ScriptProcessorNodes which are the only nodes where you can

Powered by Google App Engine
This is Rietveld 408576698