bug 1092932 detach MediaSource before initiating MDStateMachine shutdown r=bholley

to avoid races between the detach process and decoder task queue shutdown.

--HG--
extra : rebase_source : 91761d9594c53a7ccb974caf4931bcac90533e5a
This commit is contained in:
Karl Tomlinson 2014-11-04 17:24:52 +13:00
parent 91343433d8
commit 59ea4cd97e

View File

@ -95,11 +95,13 @@ void
MediaSourceDecoder::Shutdown()
{
MSE_DEBUG("MediaSourceDecoder(%p)::Shutdown", this);
MediaDecoder::Shutdown();
// Detach first so that TrackBuffers are unused on the main thread when
// shut down on the decode task queue.
if (mMediaSource) {
mMediaSource->Detach();
}
MediaDecoder::Shutdown();
// Kick WaitForData out of its slumber.
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
mon.NotifyAll();