Bug 1215447 - move flag setting from SeekStarted() to Seek(). r=roc.
--- 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"));