Bug 1334230 - media.wmf.allow-unsupported-resolutions=true should not disable H264 - r=jya
authorGerald Squelart <gsquelart@mozilla.com>
Fri, 27 Jan 2017 06:58:41 +1100
changeset 331280 d4df7b5bddb549fab08eeacd73a57e2d00ee9088
parent 331279 8ec0bc50d7a4f558252ace9d6c096d54a47880cf
child 331281 31fac390e15db69d51aab3ea76764871a1a2a5ea
push id31265
push usercbook@mozilla.com
push dateFri, 27 Jan 2017 09:41:20 +0000
treeherdermozilla-central@dad46f412588 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1334230
milestone54.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 1334230 - media.wmf.allow-unsupported-resolutions=true should not disable H264 - r=jya Previously the combined tests meant that if a track was H264, and we supported H264, BUT media.wmf.allow-unsupported-resolutions==true, we would just skip the whole block, meaning we would return 'false' (unsupported) in the end. Instead, if a track is H264, and we support H264, we should return 'true' (supported), unless media.wmf.allow-unsupported-resolutions==false and the resolution is too high. MozReview-Commit-ID: 5YUhlxmfPIO
dom/media/platforms/wmf/WMFDecoderModule.cpp
--- a/dom/media/platforms/wmf/WMFDecoderModule.cpp
+++ b/dom/media/platforms/wmf/WMFDecoderModule.cpp
@@ -205,32 +205,32 @@ bool
 WMFDecoderModule::Supports(const TrackInfo& aTrackInfo,
                            DecoderDoctorDiagnostics* aDiagnostics) const
 {
   if ((aTrackInfo.mMimeType.EqualsLiteral("audio/mp4a-latm") ||
        aTrackInfo.mMimeType.EqualsLiteral("audio/mp4")) &&
        WMFDecoderModule::HasAAC()) {
     return true;
   }
-  if (MP4Decoder::IsH264(aTrackInfo.mMimeType) &&
-      WMFDecoderModule::HasH264() &&
-      !MediaPrefs::PDMWMFAllowUnsupportedResolutions()) {
-    const VideoInfo* videoInfo = aTrackInfo.GetAsVideoInfo();
-    MOZ_ASSERT(videoInfo);
-    // Check Windows format constraints, based on:
-    // https://msdn.microsoft.com/en-us/library/windows/desktop/dd797815(v=vs.85).aspx
-    if (IsWin8OrLater()) {
-      // Windows >7 supports at most 4096x2304.
-      if (videoInfo->mImage.width > 4096 || videoInfo->mImage.height > 2304) {
-        return false;
-      }
-    } else {
-      // Windows <=7 supports at most 1920x1088.
-      if (videoInfo->mImage.width > 1920 || videoInfo->mImage.height > 1088) {
-        return false;
+  if (MP4Decoder::IsH264(aTrackInfo.mMimeType) && WMFDecoderModule::HasH264()) {
+    if (!MediaPrefs::PDMWMFAllowUnsupportedResolutions()) {
+      const VideoInfo* videoInfo = aTrackInfo.GetAsVideoInfo();
+      MOZ_ASSERT(videoInfo);
+      // Check Windows format constraints, based on:
+      // https://msdn.microsoft.com/en-us/library/windows/desktop/dd797815(v=vs.85).aspx
+      if (IsWin8OrLater()) {
+        // Windows >7 supports at most 4096x2304.
+        if (videoInfo->mImage.width > 4096 || videoInfo->mImage.height > 2304) {
+          return false;
+        }
+      } else {
+        // Windows <=7 supports at most 1920x1088.
+        if (videoInfo->mImage.width > 1920 || videoInfo->mImage.height > 1088) {
+          return false;
+        }
       }
     }
     return true;
   }
   if (aTrackInfo.mMimeType.EqualsLiteral("audio/mpeg") &&
       CanCreateWMFDecoder<CLSID_CMP3DecMediaObject>()) {
     return true;
   }