Bug 1314554 - Don't enter dormant when the media is not seekable. r=jya
authorJW Wang <jwwang@mozilla.com>
Wed, 09 Nov 2016 14:21:16 +0800
changeset 352272 9479284d16ea0dc73893ec55baac7a06c7c5bf8e
parent 352271 bf09a2e3fb6b97636484eb81af709790b6a4d60e
child 352273 8b045b23dd94b54b385ad7cca335b79b87f91f42
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1314554
milestone52.0a1
Bug 1314554 - Don't enter dormant when the media is not seekable. r=jya 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
dom/media/MediaDecoderStateMachine.cpp
--- 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;