Bug 1396547 - use Supports() in PDMFactory::CreateDecoder() instread of SupportsMimeType(). r=jya
authorAlastor Wu <alwu@mozilla.com>
Mon, 04 Sep 2017 18:50:23 +0800
changeset 428591 9f16ba6aac284410382468685bcafe73bf529fd1
parent 428590 91593cfd741b6915ff526151d4a3201720438072
child 428592 7b5c9a5e8ddd9608e03dadb656d86110c4a79fa8
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1396547
milestone57.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 1396547 - use Supports() in PDMFactory::CreateDecoder() instread of SupportsMimeType(). r=jya The TrackInfo [1] created in WMFDecoderModule::SupportsMimeType() doesn't contain valid image's width and height, because the TrackInfo is created without width and height [2] and the default width and height are both -1 [3]. Thesefore, we can't correctly check whether this resolution is supported by MFT [4]. We should use Supports() instead of SupportsMimeType(). [1] https://goo.gl/QV8Jgm [2] https://goo.gl/4siShn [3] https://goo.gl/BDoXYf [4] https://goo.gl/BZh4QA MozReview-Commit-ID: 4dIJ84eaytq
dom/media/platforms/PDMFactory.cpp
--- a/dom/media/platforms/PDMFactory.cpp
+++ b/dom/media/platforms/PDMFactory.cpp
@@ -225,17 +225,17 @@ PDMFactory::CreateDecoder(const CreateDe
       diagnostics->SetFFmpegFailedToLoad();
     }
     if (mGMPPDMFailedToStartup) {
       diagnostics->SetGMPPDMFailedToStartup();
     }
   }
 
   for (auto& current : mCurrentPDMs) {
-    if (!current->SupportsMimeType(config.mMimeType, diagnostics)) {
+    if (!current->Supports(config, diagnostics)) {
       continue;
     }
     RefPtr<MediaDataDecoder> m = CreateDecoderWithPDM(current, aParams);
     if (m) {
       return m.forget();
     }
   }
   NS_WARNING("Unable to create a decoder, no platform found.");