Bug 1112410 - Handle set dormant during seeking r=cpearce a=sledru
authorSotaro Ikeda <sikeda@mozilla.com>
Mon, 12 Jan 2015 15:08:55 -0800
changeset 242879 5d185a7d03b5
parent 242878 9b99fc7b7c20
child 242880 2fd253435fe4
push id4327
push userrgiles@mozilla.com
push date2015-01-15 17:13 +0000
treeherdermozilla-beta@5d185a7d03b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, sledru
bugs1112410
milestone36.0
Bug 1112410 - Handle set dormant during seeking r=cpearce a=sledru
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1420,16 +1420,25 @@ void MediaDecoderStateMachine::SetDorman
 
   if (!mReader) {
     return;
   }
 
   DECODER_LOG("SetDormant=%d", aDormant);
 
   if (aDormant) {
+    if (mState == DECODER_STATE_SEEKING && !mQueuedSeekTarget.IsValid()) {
+      if (mSeekTarget.IsValid()) {
+        mQueuedSeekTarget = mSeekTarget;
+      } else if (mCurrentSeekTarget.IsValid()) {
+        mQueuedSeekTarget = mCurrentSeekTarget;
+      }
+    }
+    mSeekTarget.Reset();
+    mCurrentSeekTarget.Reset();
     ScheduleStateMachine();
     SetState(DECODER_STATE_DORMANT);
     mDecoder->GetReentrantMonitor().NotifyAll();
   } else if ((aDormant != true) && (mState == DECODER_STATE_DORMANT)) {
     mDecodingFrozenAtStateMetadata = true;
     mDecodingFrozenAtStateDecoding = true;
     ScheduleStateMachine();
     mCurrentFrameTime = 0;