From 7cdb62ba5fdfcd033dbdb028e320a1049ead6d11 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Fri, 24 Jul 2015 16:30:26 +0200 Subject: [PATCH] Backed out changeset 3620404c8725 (bug 1129882) --- dom/html/HTMLMediaElement.cpp | 29 +++++++++------------ dom/media/webaudio/AudioDestinationNode.cpp | 6 ++--- dom/media/webaudio/AudioDestinationNode.h | 2 +- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index d305404bd1f0..a2471b67b9e4 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -2025,8 +2025,7 @@ HTMLMediaElement::HTMLMediaElement(already_AddRefed& aNo mAutoplaying(true), mAutoplayEnabled(true), mPaused(true), - mMuted(AudioChannelService::IsAudioChannelMutedByDefault() - ? MUTED_BY_AUDIO_CHANNEL : 0), + mMuted(0), mStatsShowing(false), mAllowCasting(false), mIsCasting(false), @@ -4448,20 +4447,18 @@ nsresult HTMLMediaElement::UpdateChannelMuteState(float aVolume, bool aMuted) SetVolumeInternal(); } - if (aMuted != ComputedMuted()) { - // We have to mute this channel. - if (aMuted && !ComputedMuted()) { - SetMutedInternal(mMuted | MUTED_BY_AUDIO_CHANNEL); - if (UseAudioChannelAPI() && !mHaveDispatchedInterruptBeginEvent) { - DispatchAsyncEvent(NS_LITERAL_STRING("mozinterruptbegin")); - mHaveDispatchedInterruptBeginEvent = true; - } - } else if (!aMuted && ComputedMuted()) { - SetMutedInternal(mMuted & ~MUTED_BY_AUDIO_CHANNEL); - if (UseAudioChannelAPI() && mHaveDispatchedInterruptBeginEvent) { - mHaveDispatchedInterruptBeginEvent = false; - DispatchAsyncEvent(NS_LITERAL_STRING("mozinterruptend")); - } + // We have to mute this channel. + if (aMuted && !ComputedMuted()) { + SetMutedInternal(mMuted | MUTED_BY_AUDIO_CHANNEL); + if (UseAudioChannelAPI()) { + DispatchAsyncEvent(NS_LITERAL_STRING("mozinterruptbegin")); + mHaveDispatchedInterruptBeginEvent = true; + } + } else if (!aMuted && ComputedMuted()) { + SetMutedInternal(mMuted & ~MUTED_BY_AUDIO_CHANNEL); + if (UseAudioChannelAPI() && mHaveDispatchedInterruptBeginEvent) { + mHaveDispatchedInterruptBeginEvent = false; + DispatchAsyncEvent(NS_LITERAL_STRING("mozinterruptend")); } } diff --git a/dom/media/webaudio/AudioDestinationNode.cpp b/dom/media/webaudio/AudioDestinationNode.cpp index c8f231e21026..a7c328d4f41f 100644 --- a/dom/media/webaudio/AudioDestinationNode.cpp +++ b/dom/media/webaudio/AudioDestinationNode.cpp @@ -322,7 +322,7 @@ AudioDestinationNode::AudioDestinationNode(AudioContext* aContext, , mFramesToProduce(aLength) , mAudioChannel(AudioChannel::Normal) , mIsOffline(aIsOffline) - , mAudioChannelAgentMuted(AudioChannelService::IsAudioChannelMutedByDefault()) + , mAudioChannelAgentPlaying(false) , mExtraCurrentTime(0) , mExtraCurrentTimeSinceLastStartedBlocking(0) , mExtraCurrentTimeUpdatedSinceLastStableState(false) @@ -492,8 +492,8 @@ AudioDestinationNode::SetCanPlay(float aVolume, bool aMuted) NS_IMETHODIMP AudioDestinationNode::WindowVolumeChanged(float aVolume, bool aMuted) { - if (aMuted != mAudioChannelAgentMuted) { - mAudioChannelAgentMuted = aMuted; + if (aMuted != mAudioChannelAgentPlaying) { + mAudioChannelAgentPlaying = aMuted; if (UseAudioChannelAPI() && (mHaveDispatchedInterruptBeginEvent || aMuted)) { diff --git a/dom/media/webaudio/AudioDestinationNode.h b/dom/media/webaudio/AudioDestinationNode.h index 862363a7a759..9fecfbb19d78 100644 --- a/dom/media/webaudio/AudioDestinationNode.h +++ b/dom/media/webaudio/AudioDestinationNode.h @@ -105,7 +105,7 @@ private: // Audio Channel Type. AudioChannel mAudioChannel; bool mIsOffline; - bool mAudioChannelAgentMuted; + bool mAudioChannelAgentPlaying; TimeStamp mStartedBlockingDueToBeingOnlyNode; double mExtraCurrentTime;