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 77657 7a0db9bd7c37448ffa06b22448f93a6dc240c968
parent 77656 f27d8d9c8779883c1c4004780d6e6a2bb8d6a576
child 77658 d305835a6726fedcace500c062f2096ea6983344
child 77679 ee8a3069dc4c8d2ef94b6df6124921ee020e09ad
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewerskinetik
bugs686942
milestone9.0a1
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()