Bug 1348432 - while shutting down a MediaDecoder, ask its owner to remove all media tracks; r?jwwang draft
authorKaku Kuo <kaku@mozilla.com>
Mon, 20 Mar 2017 11:08:14 +0800
changeset 501366 9ffdf9146b725257a537bbf1afe63949d3ca5e65
parent 500857 23a4b7430dd7e83a2809bf3dc41471f154301eda
child 549846 8281906d4eafd9f747940655a2a587db10f06917
push id49945
push userbmo:kaku@mozilla.com
push dateMon, 20 Mar 2017 03:09:02 +0000
reviewersjwwang
bugs1348432
milestone55.0a1
Bug 1348432 - while shutting down a MediaDecoder, ask its owner to remove all media tracks; r?jwwang MozReview-Commit-ID: AxGBTYiQuG0
dom/media/MediaDecoder.cpp
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -507,16 +507,19 @@ MediaDecoder::Shutdown()
   }
 
   // Force any outstanding seek and byterange requests to complete
   // to prevent shutdown from deadlocking.
   if (mResource) {
     mResource->Close();
   }
 
+  // Ask the owner to remove its audio/video tracks.
+  GetOwner()->RemoveMediaTracks();
+
   ChangeState(PLAY_STATE_SHUTDOWN);
   mOwner = nullptr;
 }
 
 void
 MediaDecoder::NotifyXPCOMShutdown()
 {
   MOZ_ASSERT(NS_IsMainThread());