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 288393 feb18f1bdeaac7c8e3122824c307b3314747d1ee
parent 288392 4367154a39b1afb2a0e9f573b26ee49cb5cad138
child 288394 6fb2fb69fe674e2b776a427f4f3e36f235aa3a55
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [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;
   }