Bug 1042003 - Convert secs to usecs before passing to SeekTarget. r=roc, a=2.0+
authorVasanthakumar Pandurangan <vasanth@codeaurora.org>
Tue, 22 Jul 2014 03:54:32 -0700
changeset 203190 3100edc0df155fcbe7e54280fe0af4a95c991713
parent 203189 611a9dae1168edcd8fea228048ea6f7b44e086c3
child 203191 e1abbe73a3ea8f977802b41db4f1dae0dea2c13c
push id22
push userryanvm@gmail.com
push dateWed, 23 Jul 2014 19:41:22 +0000
treeherdermozilla-b2g32_v2_0@3100edc0df15 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, 2.0
bugs1042003
milestone32.0
Bug 1042003 - Convert secs to usecs before passing to SeekTarget. r=roc, a=2.0+
content/media/MediaDecoder.cpp
content/media/omx/MediaOmxDecoder.cpp
--- a/content/media/MediaDecoder.cpp
+++ b/content/media/MediaDecoder.cpp
@@ -124,17 +124,20 @@ void MediaDecoder::SetDormantIfNecessary
   }
 
   if(aDormant) {
     // enter dormant state
     StopProgress();
     DestroyDecodedStream();
     mDecoderStateMachine->SetDormant(true);
 
-    mRequestedSeekTarget = SeekTarget(mCurrentTime, SeekTarget::Accurate);
+    int64_t timeUsecs = 0;
+    SecondsToUsecs(mCurrentTime, timeUsecs);
+    mRequestedSeekTarget = SeekTarget(timeUsecs, SeekTarget::Accurate);
+
     if (mPlayState == PLAY_STATE_PLAYING){
       mNextState = PLAY_STATE_PLAYING;
     } else {
       mNextState = PLAY_STATE_PAUSED;
     }
     mNextState = mPlayState;
     mIsDormant = true;
     mIsExitingDormant = false;
--- a/content/media/omx/MediaOmxDecoder.cpp
+++ b/content/media/omx/MediaOmxDecoder.cpp
@@ -2,16 +2,17 @@
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "MediaOmxDecoder.h"
 #include "MediaOmxReader.h"
 #include "MediaDecoderStateMachine.h"
+#include "VideoUtils.h"
 
 #include "OmxDecoder.h"
 
 #ifdef MOZ_AUDIO_OFFLOAD
 #include "AudioOffloadPlayer.h"
 #endif
 
 using namespace android;
@@ -109,17 +110,19 @@ void MediaOmxDecoder::ResumeStateMachine
       mCurrentTime));
 
   if (!mDecoderStateMachine) {
     return;
   }
 
   mFallbackToStateMachine = true;
   mAudioOffloadPlayer = nullptr;
-  mRequestedSeekTarget = SeekTarget(mCurrentTime, SeekTarget::Accurate);
+  int64_t timeUsecs = 0;
+  SecondsToUsecs(mCurrentTime, timeUsecs);
+  mRequestedSeekTarget = SeekTarget(timeUsecs, SeekTarget::Accurate);
 
   mNextState = mPlayState;
   ChangeState(PLAY_STATE_LOADING);
   mDecoderStateMachine->SetDormant(false);
 }
 
 void MediaOmxDecoder::AudioOffloadTearDown()
 {