Bug 1539045 remove unnecessary !mRealtime checks with mForcedShutDown r=padenot

These are unnecessary because non-empty !mRealtime graphs also set
mForcedShutDown before progressing to
LIFECYCLE_WAITING_FOR_MAIN_THREAD_CLEANUP.

This reverts some of
https://hg.mozilla.org/mozilla-central/rev/d0d427badc22afa7d5406e4e376bf27df0c0aaba#l1.72
which is possible because a non-realtime graph no longer progresses to
LIFECYCLE_WAITING_FOR_MAIN_THREAD_CLEANUP when it reaches mEndTime since
https://hg.mozilla.org/mozilla-central/rev/61d08765489c#l1.41

Differential Revision: https://phabricator.services.mozilla.com/D24855

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Karl Tomlinson 2019-03-27 14:11:33 +00:00
Родитель 8979dd6682
Коммит 03327ed124
2 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -1558,12 +1558,11 @@ class MediaStreamGraphShutDownRunnable : public Runnable {
// mGraph is no longer needed, so delete it. // mGraph is no longer needed, so delete it.
mGraph->Destroy(); mGraph->Destroy();
} else { } else {
// The graph is not empty. We must be in a forced shutdown, or a // The graph is not empty. We must be in a forced shutdown, either for
// non-realtime graph that has finished processing. Some later // process shutdown or a non-realtime graph that has finished
// AppendMessage will detect that the graph has been emptied, and // processing. Some later AppendMessage will detect that the graph has
// delete it. // been emptied, and delete it.
NS_ASSERTION(mGraph->mForceShutDown || !mGraph->mRealtime, NS_ASSERTION(mGraph->mForceShutDown, "Not in forced shutdown?");
"Not in forced shutdown?");
mGraph->LifecycleStateRef() = mGraph->LifecycleStateRef() =
MediaStreamGraphImpl::LIFECYCLE_WAITING_FOR_STREAM_DESTRUCTION; MediaStreamGraphImpl::LIFECYCLE_WAITING_FOR_STREAM_DESTRUCTION;
} }
@ -1730,7 +1729,7 @@ void MediaStreamGraphImpl::RunInStableState(bool aSourceIsMSG) {
} }
} }
if ((mForceShutDown || !mRealtime) && if (mForceShutDown &&
LifecycleStateRef() == LIFECYCLE_WAITING_FOR_MAIN_THREAD_CLEANUP) { LifecycleStateRef() == LIFECYCLE_WAITING_FOR_MAIN_THREAD_CLEANUP) {
// Defer calls to RunDuringShutdown() to happen while mMonitor is not // Defer calls to RunDuringShutdown() to happen while mMonitor is not
// held. // held.

Просмотреть файл

@ -812,7 +812,8 @@ class MediaStreamGraphImpl : public MediaStreamGraph,
} }
/** /**
* True when we need to do a forced shutdown during application shutdown. * True when we need to do a forced shutdown, during application shutdown or
* when shutting down a non-realtime graph.
* Only set on main thread. * Only set on main thread.
* Can be read safely on the main thread, on all other threads mMonitor must * Can be read safely on the main thread, on all other threads mMonitor must
* be held. * be held.