diff --git a/dom/media/MediaDecoder.cpp b/dom/media/MediaDecoder.cpp index 8c1f5b293bda..4a0a43a21c8f 100644 --- a/dom/media/MediaDecoder.cpp +++ b/dom/media/MediaDecoder.cpp @@ -458,13 +458,12 @@ void MediaDecoder::Shutdown() mShuttingDown = true; - mTimedMetadataListener.Disconnect(); - // This changes the decoder state to SHUTDOWN and does other things // necessary to unblock the state machine thread if it's blocked, so // the asynchronous shutdown in nsDestroyStateMachine won't deadlock. if (mDecoderStateMachine) { mDecoderStateMachine->DispatchShutdown(); + mTimedMetadataListener.Disconnect(); } // Force any outstanding seek and byterange requests to complete diff --git a/dom/media/MediaDecoder.h b/dom/media/MediaDecoder.h index f6454afadc2c..5507fea12124 100644 --- a/dom/media/MediaDecoder.h +++ b/dom/media/MediaDecoder.h @@ -184,6 +184,10 @@ destroying the MediaDecoder object. #if !defined(MediaDecoder_h_) #define MediaDecoder_h_ +#ifdef MOZ_EME +#include "mozilla/CDMProxy.h" +#endif + #include "mozilla/MozPromise.h" #include "mozilla/ReentrantMonitor.h" #include "mozilla/StateMirroring.h" @@ -191,21 +195,20 @@ destroying the MediaDecoder object. #include "mozilla/dom/AudioChannelBinding.h" -#include "nsISupports.h" +#include "necko-config.h" +#include "nsAutoPtr.h" #include "nsCOMPtr.h" #include "nsIObserver.h" -#include "nsAutoPtr.h" +#include "nsISupports.h" #include "nsITimer.h" -#include "MediaResource.h" -#include "MediaDecoderOwner.h" -#include "MediaEventSource.h" -#include "MediaStreamGraph.h" + #include "AbstractMediaDecoder.h" #include "DecodedStream.h" -#include "necko-config.h" -#ifdef MOZ_EME -#include "mozilla/CDMProxy.h" -#endif +#include "MediaDecoderOwner.h" +#include "MediaEventSource.h" +#include "MediaMetadataManager.h" +#include "MediaResource.h" +#include "MediaStreamGraph.h" #include "TimeUnits.h" class nsIStreamListener;