Bug 835454 - [Audio] AudioChannelService didn't notify agents to call getMuted() when a content channel's visibility is changed. r=baku, a=tef+

This commit is contained in:
Marco Chen 2013-01-30 10:54:07 +08:00
parent d6685ce0c8
commit 5435174ea2
2 changed files with 13 additions and 7 deletions

View File

@ -147,11 +147,12 @@ AudioChannelService::GetMuted(AudioChannelAgent* aAgent, bool aElementHidden)
return true;
}
bool muted = GetMutedInternal(data->mType, CONTENT_PARENT_NO_CHILD_ID,
aElementHidden, data->mElementHidden);
bool oldElementHidden = data->mElementHidden;
// Update visibility.
data->mElementHidden = aElementHidden;
bool muted = GetMutedInternal(data->mType, CONTENT_PARENT_NO_CHILD_ID,
aElementHidden, oldElementHidden);
data->mMuted = muted;
SendAudioChannelChangedNotification();
@ -192,6 +193,10 @@ AudioChannelService::GetMutedInternal(AudioChannelType aType, uint64_t aChildID,
mActiveContentChildIDsFrozen = true;
}
if (newType != oldType && aType == AUDIO_CHANNEL_CONTENT) {
Notify();
}
// Let play any visible audio channel.
if (!aElementHidden) {
return false;

View File

@ -66,13 +66,14 @@ AudioChannelServiceChild::GetMuted(AudioChannelAgent* aAgent, bool aElementHidde
ContentChild *cc = ContentChild::GetSingleton();
bool muted = true;
if (cc) {
cc->SendAudioChannelGetMuted(data->mType, aElementHidden, data->mElementHidden, &muted);
}
bool oldElementHidden = data->mElementHidden;
// Update visibility.
data->mElementHidden = aElementHidden;
if (cc) {
cc->SendAudioChannelGetMuted(data->mType, aElementHidden, oldElementHidden, &muted);
}
data->mMuted = muted;
if (cc) {