Bug 1454630 - P3. Always recreate the PDMFactory when CDMProxy change. r=bryce, a=RyanVM
The code couldn't have worked and didn't do what the comment stated. When the CDMProxy changes, the current PDMFactory for encrypted content can no longer be used.
MozReview-Commit-ID: 7LpcQkK5gLL
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -1529,20 +1529,18 @@ MediaFormatReader::SetCDMProxy(CDMProxy*
PrepareToSetCDMForTrack(TrackInfo::kAudioTrack);
}
if (HasVideo()) {
PrepareToSetCDMForTrack(TrackInfo::kVideoTrack);
}
mCDMProxy = aProxy;
- if (!mCDMProxy) {
- // Release old PDMFactory which contains an EMEDecoderModule.
- mEncryptedPlatform = nullptr;
- }
+ // 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
// 3) A null cdm proxy is set
// the promise can be resolved directly.
mSetCDMForTracks.clear();
return SetCDMPromise::CreateAndResolve(/* aIgnored = */ true, __func__);