Bug 1314554 - Don't enter dormant when the media is not seekable.
This change deals with chained ogg files. A decoding error is encountered
even without seeking when exiting dormant. For now, we disable dormant
for there files that are not seekable to avoid playback looks broken
(due to decode error when exiting dormant) on Firefox.
MozReview-Commit-ID: 72axKPHwoIi
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -701,16 +701,22 @@ private:
void EnterDormant()
{
SetState<DormantState>();
}
void StartDormantTimer()
{
+ if (!mMaster->mMediaSeekable) {
+ // Don't enter dormant if the media is not seekable because we need to
+ // seek when exiting dormant.
+ return;
+ }
+
auto timeout = MediaPrefs::DormantOnPauseTimeout();
if (timeout < 0) {
// Disabled when timeout is negative.
return;
} else if (timeout == 0) {
// Enter dormant immediately without scheduling a timer.
EnterDormant();
return;