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 225492 2d0a1d87170024ca2ef2d2a5400f9b8ffe143373
parent 225491 c033be95eb1f218b60182b9613c905b3f46a6450
child 225493 86da49382e3ba111380edf4183a2b6203456ed2f
push id7107
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 17:43:31 +0000
treeherdermozilla-aurora@b4b34e0acc75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik
bugs1080958
milestone35.0a1
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;
 }