Bug 1567170 - P1. Shutdown demuxer earlier. r=decoder
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 12 Aug 2019 12:04:42 +0000
changeset 487885 30be24d99ba234466072bcde7093bae7b21d5a43
parent 487884 2cee544a6859c721ea6abe2f47dd492e80658489
child 487886 58c2f8a1f33784154f7810c8e00799c6da307696
push id36433
push userbtara@mozilla.com
push dateWed, 14 Aug 2019 21:57:52 +0000
treeherdermozilla-central@7d9a2196d313 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdecoder
bugs1567170
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1567170 - P1. Shutdown demuxer earlier. r=decoder If for some reason mDecoder didn't exist, we would get an assertion inside FinalizeShutdown(). Differential Revision: https://phabricator.services.mozilla.com/D41359
dom/media/Benchmark.cpp
--- a/dom/media/Benchmark.cpp
+++ b/dom/media/Benchmark.cpp
@@ -274,38 +274,38 @@ void BenchmarkPlayback::FinalizeShutdown
 
 void BenchmarkPlayback::GlobalShutdown() {
   MOZ_ASSERT(OnThread());
 
   MOZ_ASSERT(!mFinished, "We've already shutdown");
 
   mFinished = true;
 
+  if (mTrackDemuxer) {
+    mTrackDemuxer->Reset();
+    mTrackDemuxer->BreakCycles();
+    mTrackDemuxer = nullptr;
+  }
+  mDemuxer = nullptr;
+
   if (mDecoder) {
     RefPtr<Benchmark> ref(mGlobalState);
     mDecoder->Flush()->Then(
         Thread(), __func__,
         [ref, this]() {
           mDecoder->Shutdown()->Then(
               Thread(), __func__, [ref, this]() { FinalizeShutdown(); },
               []() { MOZ_CRASH("not reached"); });
           mDecoder = nullptr;
           mInfo = nullptr;
         },
         []() { MOZ_CRASH("not reached"); });
   } else {
     FinalizeShutdown();
   }
-
-  if (mTrackDemuxer) {
-    mTrackDemuxer->Reset();
-    mTrackDemuxer->BreakCycles();
-    mTrackDemuxer = nullptr;
-  }
-  mDemuxer = nullptr;
 }
 
 void BenchmarkPlayback::Output(MediaDataDecoder::DecodedData&& aResults) {
   MOZ_ASSERT(OnThread());
   MOZ_ASSERT(!mFinished);
 
   RefPtr<Benchmark> ref(mGlobalState);
   mFrameCount += aResults.Length();