Bug 1348432 - while shutting down a MediaDecoder, ask its owner to remove all media tracks; r?jwwang
MozReview-Commit-ID: AxGBTYiQuG0
--- 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());