Backed out changeset 3620404c8725 (bug 1129882)

This commit is contained in:
Carsten "Tomcat" Book 2015-07-24 16:30:26 +02:00
Родитель d84cdb4785
Коммит 7cdb62ba5f
3 изменённых файлов: 17 добавлений и 20 удалений

Просмотреть файл

@ -2025,8 +2025,7 @@ HTMLMediaElement::HTMLMediaElement(already_AddRefed<mozilla::dom::NodeInfo>& 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"));
}
}

Просмотреть файл

@ -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)) {

Просмотреть файл

@ -105,7 +105,7 @@ private:
// Audio Channel Type.
AudioChannel mAudioChannel;
bool mIsOffline;
bool mAudioChannelAgentMuted;
bool mAudioChannelAgentPlaying;
TimeStamp mStartedBlockingDueToBeingOnlyNode;
double mExtraCurrentTime;