Bug 1454630 - P3. Always recreate the PDMFactory when CDMProxy change. r?bryce draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 28 May 2018 14:46:35 +0200
changeset 800555 4cf3d9f1f1a4e3213db50b0e8d6454d4783d0141
parent 800554 3921cd4b0d05484247b19341b5eeb13e7a073e7f
child 800556 863dc369b417e825eac8ffd547a9bb9fde76469a
push id111396
push userbmo:jyavenard@mozilla.com
push dateMon, 28 May 2018 13:31:40 +0000
reviewersbryce
bugs1454630
milestone62.0a1
Bug 1454630 - P3. Always recreate the PDMFactory when CDMProxy change. r?bryce 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
dom/media/MediaFormatReader.cpp
--- 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__);