From a39a70682795bcfc1538d9cea01b4563a02daef0 Mon Sep 17 00:00:00 2001 From: Karl Tomlinson Date: Tue, 30 Oct 2018 15:14:33 +0000 Subject: [PATCH] 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 --HG-- extra : moz-landing-system : lando --- dom/media/MediaStreamGraph.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dom/media/MediaStreamGraph.cpp b/dom/media/MediaStreamGraph.cpp index 7ed032276b6a..8684de3a5b13 100644 --- a/dom/media/MediaStreamGraph.cpp +++ b/dom/media/MediaStreamGraph.cpp @@ -1113,7 +1113,11 @@ MediaStreamGraphImpl::ShouldUpdateMainThread() } 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; }