Bug 1259212 - Small WMFDecoderModule::Supports refactoring - r?mattwoodrow draft
authorGerald Squelart <gsquelart@mozilla.com>
Fri, 21 Oct 2016 16:22:37 +1100
changeset 428501 50cee623f15e5ae552d1cb909a94d2e1c6650833
parent 428500 3d407ef4de42884acee02418a89ba6d1c5362967
child 428502 fdc791ab678ac0568a2d602b1d645c4b83a00f8f
push id33314
push usergsquelart@mozilla.com
push dateMon, 24 Oct 2016 02:23:32 +0000
reviewersmattwoodrow
bugs1259212
milestone52.0a1
Bug 1259212 - Small WMFDecoderModule::Supports refactoring - r?mattwoodrow No actual code change intended. This will make the next patch easier to review. MozReview-Commit-ID: BNkLomV04G7
dom/media/platforms/wmf/WMFDecoderModule.cpp
--- a/dom/media/platforms/wmf/WMFDecoderModule.cpp
+++ b/dom/media/platforms/wmf/WMFDecoderModule.cpp
@@ -209,26 +209,28 @@ WMFDecoderModule::Supports(const TrackIn
   if ((aTrackInfo.mMimeType.EqualsLiteral("audio/mp4a-latm") ||
        aTrackInfo.mMimeType.EqualsLiteral("audio/mp4")) &&
        WMFDecoderModule::HasAAC()) {
     return true;
   }
   if (MP4Decoder::IsH264(aTrackInfo.mMimeType) && WMFDecoderModule::HasH264()) {
     const VideoInfo* videoInfo = aTrackInfo.GetAsVideoInfo();
     MOZ_ASSERT(videoInfo);
+    int32_t w = videoInfo->mImage.width;
+    int32_t h = videoInfo->mImage.height;
     // 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) {
+      if (w > 4096 || h > 2304) {
         return false;
       }
     } else {
       // Windows <=7 supports at most 1920x1088.
-      if (videoInfo->mImage.width > 1920 || videoInfo->mImage.height > 1088) {
+      if (w > 1920 || h > 1088) {
         return false;
       }
     }
     return true;
   }
   if (aTrackInfo.mMimeType.EqualsLiteral("audio/mpeg") &&
       CanCreateWMFDecoder<CLSID_CMP3DecMediaObject>()) {
     return true;