Bug 686942: respect pause state when seeking to end and beginning of videos - r=kinetik
authorChris Double <chris.double@double.co.nz>
Tue, 27 Sep 2011 15:22:09 +1300
changeset 78968 7a0db9bd7c37448ffa06b22448f93a6dc240c968
parent 78967 f27d8d9c8779883c1c4004780d6e6a2bb8d6a576
child 78969 d305835a6726fedcace500c062f2096ea6983344
child 78990 ee8a3069dc4c8d2ef94b6df6124921ee020e09ad
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik
bugs686942
milestone9.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 686942: respect pause state when seeking to end and beginning of videos - r=kinetik
content/media/nsBuiltinDecoder.cpp
--- a/content/media/nsBuiltinDecoder.cpp
+++ b/content/media/nsBuiltinDecoder.cpp
@@ -348,22 +348,21 @@ nsresult nsBuiltinDecoder::Seek(double a
 
   mRequestedSeekTime = aTime;
   mCurrentTime = aTime;
 
   // If we are already in the seeking state, then setting mRequestedSeekTime
   // above will result in the new seek occurring when the current seek
   // completes.
   if (mPlayState != PLAY_STATE_SEEKING) {
-    if (mPlayState == PLAY_STATE_ENDED) {
-      mNextState = PLAY_STATE_PLAYING;
+    PRBool paused = PR_FALSE;
+    if (mElement) {
+      mElement->GetPaused(&paused);
     }
-    else {
-      mNextState = mPlayState;
-    }
+    mNextState = paused ? PLAY_STATE_PAUSED : PLAY_STATE_PLAYING;
     PinForSeek();
     ChangeState(PLAY_STATE_SEEKING);
   }
 
   return ScheduleStateMachineThread();
 }
 
 nsresult nsBuiltinDecoder::PlaybackRateChanged()