Bug 1256510: When shutting down MediaStreamGraphs, if the graph hasn't started, let it start and shut down r=padenot

MozReview-Commit-ID: 64WjTbaduvu
This commit is contained in:
Randell Jesup 2016-03-15 11:46:01 -04:00
parent 0c0862c4c2
commit ef46e30953
2 changed files with 10 additions and 1 deletions

View File

@ -212,7 +212,8 @@ public:
}
} else {
MonitorAutoLock mon(mDriver->mGraphImpl->GetMonitor());
MOZ_ASSERT(mDriver->mGraphImpl->MessagesQueued(), "Don't start a graph without messages queued.");
MOZ_ASSERT(mDriver->mGraphImpl->MessagesQueued() ||
mDriver->mGraphImpl->mForceShutDown, "Don't start a graph without messages queued.");
mDriver->mGraphImpl->SwapMessageQueues();
}
mDriver->RunThread();

View File

@ -1481,6 +1481,14 @@ MediaStreamGraphImpl::ForceShutDown(ShutdownTicket* aShutdownTicket)
MonitorAutoLock lock(mMonitor);
mForceShutDown = true;
mForceShutdownTicket = aShutdownTicket;
if (mLifecycleState == LIFECYCLE_THREAD_NOT_STARTED) {
// We *could* have just sent this a message to start up, so don't
// yank the rug out from under it. Tell it to startup and let it
// shut down.
RefPtr<GraphDriver> driver = CurrentDriver();
MonitorAutoUnlock unlock(mMonitor);
driver->Start();
}
EnsureNextIterationLocked();
}
}