Bug 1215447 - move flag setting from SeekStarted() to Seek(). r=roc.
authorAlastor Wu <alwu@mozilla.com>
Thu, 22 Oct 2015 11:37:16 +0800
changeset 268868 a1059127579d6aaf3bce6ec534edea09c7f59860
parent 268867 4084fa04400bba8f8d7c7f779c0984c6464a1394
child 268869 26f3141405864a1df88a7e8292f74dc65694bf60
push id18223
push usercbook@mozilla.com
push dateThu, 22 Oct 2015 07:01:46 +0000
treeherderb2g-inbound@a1059127579d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1215447
milestone44.0a1
Bug 1215447 - move flag setting from SeekStarted() to Seek(). r=roc.
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -1585,16 +1585,21 @@ HTMLMediaElement::Seek(double aTime,
   // TODO: The spec requires us to update the current time to reflect the
   //       actual seek target before beginning the synchronous section, but
   //       that requires changing all MediaDecoderReaders to support telling
   //       us the fastSeek target, and it's currently not possible to get
   //       this information as we don't yet control the demuxer for all
   //       MediaDecoderReaders.
 
   mPlayingBeforeSeek = IsPotentiallyPlaying();
+  // Set the Variable if the Seekstarted while active playing
+  if (mPlayingThroughTheAudioChannel) {
+    mPlayingThroughTheAudioChannelBeforeSeek = true;
+  }
+
   // The media backend is responsible for dispatching the timeupdate
   // event if it changes the playback position as a result of the seek.
   LOG(LogLevel::Debug, ("%p SetCurrentTime(%f) starting seek", this, aTime));
   nsresult rv = mDecoder->Seek(aTime, aSeekType);
   if (NS_FAILED(rv)) {
     aRv.Throw(rv);
   }
 
@@ -3540,20 +3545,16 @@ void HTMLMediaElement::PlaybackEnded()
 
   FireTimeUpdate(false);
   DispatchAsyncEvent(NS_LITERAL_STRING("ended"));
 }
 
 void HTMLMediaElement::SeekStarted()
 {
   DispatchAsyncEvent(NS_LITERAL_STRING("seeking"));
-  // Set the Variable if the Seekstarted while active playing
-  if(mPlayingThroughTheAudioChannel) {
-    mPlayingThroughTheAudioChannelBeforeSeek = true;
-  }
 }
 
 void HTMLMediaElement::SeekCompleted()
 {
   mPlayingBeforeSeek = false;
   SetPlayedOrSeeked(true);
   FireTimeUpdate(false);
   DispatchAsyncEvent(NS_LITERAL_STRING("seeked"));