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 473587 5326f573aaec25b0842d2f2695cce82757fd52e6
parent 473586 ed4aa0f2e4e3d0dc6e42be601db945310526d6ec
child 473588 b4d1d4787481751c6809033303d3d8381bc56f5c
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbryce, RyanVM
bugs1454630
milestone61.0
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
@@ -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__);