Bug 1503132 when graph time has not advanced, only ensure another iteration if rendering r=padenot
authorKarl Tomlinson <karlt+@karlt.net>
Tue, 30 Oct 2018 15:14:35 +0000
changeset 443666 7e9935a07eaf0bc2f25e6fa7b49446f9c815e0b2
parent 443665 de7f45d6f032f18343fc5848ac5c0273c075e1c6
child 443667 61d08765489c9e1edda2b4105287caf401deb94a
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 when graph time has not advanced, only ensure another iteration if rendering r=padenot Depends on D10164 Differential Revision: https://phabricator.services.mozilla.com/D10165
dom/media/MediaStreamGraph.cpp
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -1343,24 +1343,26 @@ MediaStreamGraphImpl::UpdateGraph(GraphT
       }
     }
   }
 
   for (MediaStream* stream : mSuspendedStreams) {
     stream->mStartBlocking = mStateComputedTime;
   }
 
-  // The loop is woken up so soon that IterationEnd() barely advances and we
-  // end up having aEndBlockingDecision == mStateComputedTime.
-  // Since stream blocking is computed in the interval of
-  // [mStateComputedTime, aEndBlockingDecision), it won't be computed at all.
-  // We should ensure next iteration so that pending blocking changes will be
-  // computed in next loop.
+  // If the loop is woken up so soon that IterationEnd() barely advances or
+  // if an offline graph is not currently rendering, we end up having
+  // aEndBlockingDecisions == mStateComputedTime.
+  // Since the process interval [mStateComputedTime, aEndBlockingDecision) is
+  // empty, Process() will not find any unblocked stream and so will not
+  // ensure another iteration.  If the graph should be rendering, then ensure
+  // another iteration to render.
   if (ensureNextIteration ||
-      aEndBlockingDecisions == mStateComputedTime) {
+      (aEndBlockingDecisions == mStateComputedTime &&
+       mStateComputedTime < mEndTime)) {
     EnsureNextIteration();
   }
 }
 
 void
 MediaStreamGraphImpl::Process()
 {
   TRACE_AUDIO_CALLBACK();