diff --git a/dom/audiochannel/AudioChannelService.cpp b/dom/audiochannel/AudioChannelService.cpp index 3b2d8c57456..99ab9d6c782 100644 --- a/dom/audiochannel/AudioChannelService.cpp +++ b/dom/audiochannel/AudioChannelService.cpp @@ -586,14 +586,18 @@ AudioChannelService::SendAudioChannelChangedNotification(uint64_t aChildID) kMozAudioChannelAttributeTable[index].value > higher && kMozAudioChannelAttributeTable[index].value > (int16_t)AudioChannel::Normal; --index) { - if (kMozAudioChannelAttributeTable[index].value == (int16_t)AudioChannel::Content && - mPlayableHiddenContentChildID != CONTENT_PROCESS_ID_UNKNOWN) { - higher = kMozAudioChannelAttributeTable[index].value; - } - // Each channel type will be split to fg and bg for recording the state, // so here need to do a translation. - if (!mChannelCounters[index * 2 + 1].IsEmpty()) { + if (mChannelCounters[index * 2 + 1].IsEmpty()) { + continue; + } + + if (kMozAudioChannelAttributeTable[index].value == (int16_t)AudioChannel::Content) { + if (mPlayableHiddenContentChildID != CONTENT_PROCESS_ID_UNKNOWN) { + higher = kMozAudioChannelAttributeTable[index].value; + break; + } + } else { higher = kMozAudioChannelAttributeTable[index].value; break; }