зеркало из https://github.com/mozilla/gecko-dev.git
Bug 818708 - Content audio channels should be muted if in background when another content audio channel is playing. r=sicking
This commit is contained in:
Родитель
1b8e54ed96
Коммит
f6c7eded41
|
@ -151,10 +151,23 @@ AudioChannelService::GetMuted(AudioChannelType aType, bool aElementHidden)
|
|||
return true;
|
||||
|
||||
case AUDIO_CHANNEL_CONTENT:
|
||||
// TODO: this should work per apps
|
||||
if (mChannelCounters[AUDIO_CHANNEL_CONTENT].Length() > 1)
|
||||
return true;
|
||||
{
|
||||
// If we have more than 1 using the content channel,
|
||||
// this must be muted.
|
||||
uint32_t childId = CONTENT_PARENT_UNKNOWN_CHILD_ID;
|
||||
bool empty = true;
|
||||
for (uint32_t i = 0;
|
||||
i < mChannelCounters[AUDIO_CHANNEL_CONTENT].Length();
|
||||
++i) {
|
||||
if (empty) {
|
||||
childId = mChannelCounters[AUDIO_CHANNEL_CONTENT][i];
|
||||
empty = false;
|
||||
}
|
||||
else if (childId != mChannelCounters[AUDIO_CHANNEL_CONTENT][i])
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case AUDIO_CHANNEL_NOTIFICATION:
|
||||
case AUDIO_CHANNEL_ALARM:
|
||||
|
|
Загрузка…
Ссылка в новой задаче