Bug 1158293 - Fix ResumeStateMachine()'s seek handling r=cpearce
authorSotaro Ikeda <sikeda@mozilla.com>
Wed, 29 Apr 2015 08:36:49 -0700
changeset 241580 02ffa1e005673c403ca746637ab24b7b5126db2b
parent 241579 e81e122159516710c783a7058129a1fb16f5bffe
child 241581 be5b399dc1a02616d7775d491a8ea64c9a507eca
push id59176
push usersikeda@mozilla.com
push dateWed, 29 Apr 2015 15:37:00 +0000
treeherdermozilla-inbound@02ffa1e00567 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1158293
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1158293 - Fix ResumeStateMachine()'s seek handling r=cpearce
dom/media/omx/MediaOmxCommonDecoder.cpp
--- a/dom/media/omx/MediaOmxCommonDecoder.cpp
+++ b/dom/media/omx/MediaOmxCommonDecoder.cpp
@@ -138,20 +138,29 @@ MediaOmxCommonDecoder::ResumeStateMachin
 
   mFallbackToStateMachine = true;
   mAudioOffloadPlayer = nullptr;
   int64_t timeUsecs = 0;
   SecondsToUsecs(mCurrentTime, timeUsecs);
   mRequestedSeekTarget = SeekTarget(timeUsecs,
                                     SeekTarget::Accurate,
                                     MediaDecoderEventVisibility::Suppressed);
+  // Call Seek of MediaDecoderStateMachine to suppress seek events.
+  RefPtr<nsRunnable> event =
+    NS_NewRunnableMethodWithArg<SeekTarget>(
+      GetStateMachine(),
+      &MediaDecoderStateMachine::Seek,
+      mRequestedSeekTarget);
+  GetStateMachine()->TaskQueue()->Dispatch(event);
+  mRequestedSeekTarget.Reset();
+
   mNextState = mPlayState;
   ChangeState(PLAY_STATE_LOADING);
   // exit dormant state
-  RefPtr<nsRunnable> event =
+  event =
     NS_NewRunnableMethodWithArg<bool>(
       GetStateMachine(),
       &MediaDecoderStateMachine::SetDormant,
       false);
   GetStateMachine()->TaskQueue()->Dispatch(event);
 }
 
 void