Bug 1042003 - Convert secs to usecs before passing to SeekTarget. r=roc
authorVasanthakumar Pandurangan <vasanth@codeaurora.org>
Tue, 22 Jul 2014 03:54:32 -0700
changeset 195665 9caeb48e2eb886754cd2d01c01c45a5f0862e145
parent 195664 c1c081c08cec73ae371830236764243accc43ddc
child 195666 23b0493a228f0915d4e9fca77a23e55e7a00aaa1
push id46662
push usercbook@mozilla.com
push dateWed, 23 Jul 2014 11:48:14 +0000
treeherdermozilla-inbound@9caeb48e2eb8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1042003
milestone34.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 1042003 - Convert secs to usecs before passing to SeekTarget. r=roc
content/media/MediaDecoder.cpp
content/media/omx/MediaOmxDecoder.cpp
--- a/content/media/MediaDecoder.cpp
+++ b/content/media/MediaDecoder.cpp
@@ -130,17 +130,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;
@@ -106,17 +107,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()
 {