Bug 1515068 - Allow UpdateSrcStreamTime while paused. r=jya
authorAndreas Pehrson <apehrson@mozilla.com>
Wed, 09 Jan 2019 17:15:18 +0000
changeset 510302 efed3e60a2494a67deaabebcf71c9af24f3ddad2
parent 510301 b342c8e8306e9ab655838f211e18eb65479b29c5
child 510303 0d7629792afb8a8d932c4bef3359f39d83af13a5
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1515068
milestone66.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 1515068 - Allow UpdateSrcStreamTime while paused. r=jya This can legitimately happen while paused since the watchmanager calling this is dispatching the calls. As such they're out of sync with the paused state, and we need to allow updating the time while paused. FireTimeUpdate does ignore the call if the time hasn't actually been updated, so the only impact from this is that we could do a lot of unnecessary dispatching while paused without noticing. Differential Revision: https://phabricator.services.mozilla.com/D15731
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -4622,19 +4622,22 @@ void HTMLMediaElement::UpdateSrcMediaStr
     }
     // If stream is null, then DOMMediaStream::Destroy must have been
     // called and that will remove all listeners/outputs.
   }
 }
 
 void HTMLMediaElement::UpdateSrcStreamTime() {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(mSrcStreamPausedGraphTime == GRAPH_TIME_MAX);
-  MOZ_ASSERT(!mPaused);
-  MOZ_ASSERT(!mSrcStreamPlaybackEnded);
+
+  if (mSrcStreamPlaybackEnded) {
+    // We do a separate FireTimeUpdate() when this is set.
+    return;
+  }
+
   FireTimeUpdate(true);
 }
 
 void HTMLMediaElement::SetupSrcMediaStreamPlayback(DOMMediaStream* aStream) {
   NS_ASSERTION(!mSrcStream && !mVideoFrameListener,
                "Should have been ended already");
 
   mSrcStream = aStream;