Bug 1454630 - P3. Always recreate the PDMFactory when CDMProxy change. r=bryce, a=RyanVM
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 28 May 2018 14:46:35 +0200
changeset 449534 e90141e8315d85415680a6da293056939dbf3c0b
parent 449533 c04873fad58566b0d346d28837f6dbb91b342b8e
child 449535 89f930216fdbf1f2f64ea2385843c067bd6334ab
push id88
push userryanvm@gmail.com
push dateWed, 13 Jun 2018 23:43:49 +0000
treeherdermozilla-esr60@89f930216fdb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbryce, RyanVM
bugs1454630
milestone60.0.3
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
dom/media/MediaFormatReader.cpp
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -1523,20 +1523,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__);