Bug 1503132 update offline main thread state when there is no pending iteration r=padenot
authorKarl Tomlinson <karlt+@karlt.net>
Tue, 30 Oct 2018 15:14:33 +0000
changeset 443665 de7f45d6f032f18343fc5848ac5c0273c075e1c6
parent 443664 543cac7034fe049affde8fceb124cacf0ed7c274
child 443666 7e9935a07eaf0bc2f25e6fa7b49446f9c815e0b2
push id109420
push useraciure@mozilla.com
push dateWed, 31 Oct 2018 05:11:56 +0000
treeherdermozilla-inbound@b357da105c49 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1503132
milestone65.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 1503132 update offline main thread state when there is no pending iteration r=padenot Depends on D10163 Differential Revision: https://phabricator.services.mozilla.com/D10164
dom/media/MediaStreamGraph.cpp
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -1108,17 +1108,21 @@ bool
 MediaStreamGraphImpl::ShouldUpdateMainThread()
 {
   MOZ_ASSERT(OnGraphThreadOrNotRunning());
   if (mRealtime) {
     return true;
   }
 
   TimeStamp now = TimeStamp::Now();
-  if ((now - mLastMainThreadUpdate).ToMilliseconds() > CurrentDriver()->IterationDuration()) {
+  // For offline graphs, update now if there is no pending iteration or if it
+  // has been long enough since the last update.
+  if (!mNeedAnotherIteration ||
+      ((now - mLastMainThreadUpdate).ToMilliseconds() >
+       CurrentDriver()->IterationDuration())) {
     mLastMainThreadUpdate = now;
     return true;
   }
   return false;
 }
 
 void
 MediaStreamGraphImpl::PrepareUpdatesToMainThreadState(bool aFinalUpdate)