diff --git a/dom/media/MediaFormatReader.cpp b/dom/media/MediaFormatReader.cpp index 2da0157ee57f..59cae0f2ea9e 100644 --- a/dom/media/MediaFormatReader.cpp +++ b/dom/media/MediaFormatReader.cpp @@ -16,6 +16,7 @@ #include "MediaData.h" #include "MediaDataDecoderProxy.h" #include "MediaInfo.h" +#include "PDMFactory.h" #include "VideoFrameContainer.h" #include "VideoUtils.h" #include "mozilla/AbstractThread.h" @@ -345,15 +346,11 @@ void MediaFormatReader::DecoderFactory::DoCreateDecoder(Data& aData) { AUTO_PROFILER_LABEL("DecoderFactory::DoCreateDecoder", MEDIA_PLAYBACK); auto& ownerData = aData.mOwnerData; auto& decoder = mOwner->GetDecoderData(aData.mTrack); - auto& platform = - decoder.IsEncrypted() ? mOwner->mEncryptedPlatform : mOwner->mPlatform; - if (!platform) { - platform = new PDMFactory(); - if (decoder.IsEncrypted()) { - MOZ_ASSERT(mOwner->mCDMProxy); - platform->SetCDMProxy(mOwner->mCDMProxy); - } + RefPtr platform = new PDMFactory(); + if (decoder.IsEncrypted()) { + MOZ_ASSERT(mOwner->mCDMProxy); + platform->SetCDMProxy(mOwner->mCDMProxy); } RefPtr p; @@ -981,8 +978,6 @@ RefPtr MediaFormatReader::TearDownDecoders() { } mDecoderFactory = nullptr; - mPlatform = nullptr; - mEncryptedPlatform = nullptr; mVideoFrameContainer = nullptr; ReleaseResources(); @@ -1080,9 +1075,6 @@ RefPtr MediaFormatReader::SetCDMProxy(CDMProxy* aProxy) { mCDMProxy = aProxy; - // Release old PDMFactory which contains an EMEDecoderModule. - mEncryptedPlatform = nullptr; - if (!mInitDone || mSetCDMForTracks.isEmpty() || !mCDMProxy) { // 1) MFR is not initialized yet or // 2) Demuxer is initialized without active audio and video or diff --git a/dom/media/MediaFormatReader.h b/dom/media/MediaFormatReader.h index 707c8d9c88ab..54e9436c9f50 100644 --- a/dom/media/MediaFormatReader.h +++ b/dom/media/MediaFormatReader.h @@ -12,7 +12,6 @@ # include "MediaEventSource.h" # include "MediaMetadataManager.h" # include "MediaPromiseDefs.h" -# include "PDMFactory.h" # include "PlatformDecoderModule.h" # include "SeekTarget.h" # include "mozilla/Atomics.h" @@ -317,9 +316,6 @@ class MediaFormatReader final // This is called only on TaskQueue. void NotifyDecoderBenchmarkStore(); - RefPtr mPlatform; - RefPtr mEncryptedPlatform; - enum class DrainState { None, DrainRequested,