diff --git a/dom/media/utils/TelemetryProbesReporter.cpp b/dom/media/utils/TelemetryProbesReporter.cpp index 2a1598e38d89..3c7de0460d1d 100644 --- a/dom/media/utils/TelemetryProbesReporter.cpp +++ b/dom/media/utils/TelemetryProbesReporter.cpp @@ -159,20 +159,18 @@ void TelemetryProbesReporter::OnVisibilityChanged(Visibility aVisibility) { void TelemetryProbesReporter::OnAudibleChanged(AudibleState aAudibleState) { AssertOnMainThreadAndNotShutdown(); - LOG("Audibility changed: %s -> %s", ToAudibilityStr(mAudibleState), - ToAudibilityStr(aAudibleState)); + LOG("Audibility changed, now %s", ToAudibilityStr(aAudibleState)); if (aAudibleState == AudibleState::eNotAudible) { - MOZ_ASSERT(mAudibleState == AudibleState::eAudible); - StartInaudibleAudioTimeAccumulator(); + if (!mInaudibleAudioPlayTime.IsStarted()) { + StartInaudibleAudioTimeAccumulator(); + } } else { - MOZ_ASSERT(mAudibleState == AudibleState::eNotAudible); // This happens when starting playback, no need to pause, because it hasn't // been started yet. if (mInaudibleAudioPlayTime.IsStarted()) { PauseInaudibleAudioTimeAccumulator(); } } - mAudibleState = aAudibleState; } void TelemetryProbesReporter::OnMutedChanged(bool aMuted) { diff --git a/dom/media/utils/TelemetryProbesReporter.h b/dom/media/utils/TelemetryProbesReporter.h index 726a3a8ae24e..82140f599fcb 100644 --- a/dom/media/utils/TelemetryProbesReporter.h +++ b/dom/media/utils/TelemetryProbesReporter.h @@ -154,8 +154,6 @@ class TelemetryProbesReporter final { Visibility mMediaElementVisibility = Visibility::eInitial; - AudibleState mAudibleState = AudibleState::eNotAudible; - MediaContent mMediaContent = MediaContent::MEDIA_HAS_NOTHING; bool mIsPlaying = false;