Bug 1188131: Don't rely on MediaResource type to detect media format. r=cpearce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 06 Aug 2015 21:06:45 +1000
changeset 256743 feb18f1bdeaac7c8e3122824c307b3314747d1ee
parent 256742 4367154a39b1afb2a0e9f573b26ee49cb5cad138
child 256744 6fb2fb69fe674e2b776a427f4f3e36f235aa3a55
push id29187
push usercbook@mozilla.com
push dateFri, 07 Aug 2015 11:13:32 +0000
treeherdermozilla-central@3e51753a099f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1188131
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1188131: Don't rely on MediaResource type to detect media format. r=cpearce This information is often wrong and non-existent with MSE. Let the PDM decides later based on the metadata. This prevent hardware acceleration to be turned on leading to extremely high CPU usage on high definition videos.
dom/media/MediaFormatReader.cpp
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -149,20 +149,16 @@ MediaFormatReader::Shutdown()
   mPlatform = nullptr;
 
   return MediaDecoderReader::Shutdown();
 }
 
 void
 MediaFormatReader::InitLayersBackendType()
 {
-  if (!IsVideoContentType(mDecoder->GetResource()->GetContentType())) {
-    // Not playing video, we don't care about the layers backend type.
-    return;
-  }
   // Extract the layer manager backend type so that platform decoders
   // can determine whether it's worthwhile using hardware accelerated
   // video decoding.
   MediaDecoderOwner* owner = mDecoder->GetOwner();
   if (!owner) {
     NS_WARNING("MediaFormatReader without a decoder owner, can't get HWAccel");
     return;
   }