From 53b1ca8619b8a6de510d142b474465f8e86273df Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Sat, 15 Aug 2015 18:35:13 -0400 Subject: [PATCH] Bug 1195051 - Part 1: Do not unmute the destination node as soon as the AudioContext is constructed; r=padenot --- dom/media/webaudio/AudioDestinationNode.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dom/media/webaudio/AudioDestinationNode.cpp b/dom/media/webaudio/AudioDestinationNode.cpp index b13f3bcd8b06..dc01969210b4 100644 --- a/dom/media/webaudio/AudioDestinationNode.cpp +++ b/dom/media/webaudio/AudioDestinationNode.cpp @@ -243,7 +243,7 @@ public: explicit DestinationNodeEngine(AudioDestinationNode* aNode) : AudioNodeEngine(aNode) , mVolume(1.0f) - , mLastInputMuted(false) + , mLastInputMuted(true) { MOZ_ASSERT(aNode); } @@ -613,10 +613,6 @@ AudioDestinationNode::CreateAudioChannelAgent() static_cast(mAudioChannel), this); - // The AudioChannelAgent must start playing immediately in order to avoid - // race conditions with mozinterruptbegin/end events. - InputMuted(false); - WindowAudioCaptureChanged(); } @@ -692,7 +688,10 @@ AudioDestinationNode::InputMuted(bool aMuted) MOZ_ASSERT(Context() && !Context()->IsOffline()); if (!mAudioChannelAgent) { - return; + if (aMuted) { + return; + } + CreateAudioChannelAgent(); } if (aMuted) {