b=1080958 end current SourceBufferResource before Shutdown of TrackBuffer::mTaskQueue r=kinetik
authorKarl Tomlinson <karlt+@karlt.net>
Fri, 10 Oct 2014 17:13:10 +1300
changeset 234587 2d0a1d87170024ca2ef2d2a5400f9b8ffe143373
parent 234586 c033be95eb1f218b60182b9613c905b3f46a6450
child 234588 86da49382e3ba111380edf4183a2b6203456ed2f
push id611
push userraliiev@mozilla.com
push dateMon, 05 Jan 2015 23:23:16 +0000
treeherdermozilla-release@345cd3b9c445 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik
bugs1080958
milestone35.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
b=1080958 end current SourceBufferResource before Shutdown of TrackBuffer::mTaskQueue r=kinetik
content/media/mediasource/TrackBuffer.cpp
--- a/content/media/mediasource/TrackBuffer.cpp
+++ b/content/media/mediasource/TrackBuffer.cpp
@@ -70,24 +70,28 @@ public:
 
 private:
   nsTArray<nsRefPtr<SourceBufferDecoder>> mDecoders;
 };
 
 void
 TrackBuffer::Shutdown()
 {
+  // End the SourceBufferResource associated with mCurrentDecoder, which will
+  // unblock any decoder initialization in ReadMetadata().
+  DiscardDecoder();
+
+  // Finish any decoder initialization, which may add to mInitializedDecoders.
   // Shutdown waits for any pending events, which may require the monitor,
   // so we must not hold the monitor during this call.
   mParentDecoder->GetReentrantMonitor().AssertNotCurrentThreadIn();
   mTaskQueue->Shutdown();
   mTaskQueue = nullptr;
 
   ReentrantMonitorAutoEnter mon(mParentDecoder->GetReentrantMonitor());
-  DiscardDecoder();
   for (uint32_t i = 0; i < mDecoders.Length(); ++i) {
     mDecoders[i]->GetReader()->Shutdown();
   }
   mInitializedDecoders.Clear();
   NS_DispatchToMainThread(new ReleaseDecoderTask(mDecoders));
   MOZ_ASSERT(mDecoders.IsEmpty());
   mParentDecoder = nullptr;
 }