Bug 1452416 - Release GraphDrivers outside of StableState runnable to avoid spinning the event queue. r=smaug, r=padenot, a=RyanVM

--HG--
extra : source : c90ec782d481f05f5848f171a945cfc5bcf5b0ca
This commit is contained in:
Randell Jesup 2017-01-13 13:54:20 -05:00 committed by Roy Tam
commit 4f0786ab02

View file

@ -1715,6 +1715,10 @@ MediaStreamGraphImpl::RunInStableState(bool aSourceIsMSG)
RefPtr<GraphDriver> driver = CurrentDriver();
MonitorAutoUnlock unlock(mMonitor);
driver->Start();
// It's not safe to Shutdown() a thread from StableState, and
// releasing this may shutdown a SystemClockDriver thread.
// Proxy the release to outside of StableState.
NS_ReleaseOnMainThread(driver.forget(), true); // always proxy
}
}