Bug 1437003 - Allow H264 level up to 5.2 inclusive. r?padenot draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 01 Mar 2018 09:38:45 +0100
changeset 761601 0fb937093758d0246036a4bad8177811f64780e5
parent 761600 4ee865546ac523288b4753d266fb5e668b77d611
push id100977
push userbmo:jyavenard@mozilla.com
push dateThu, 01 Mar 2018 08:39:50 +0000
reviewerspadenot
bugs1437003
milestone60.0a1
Bug 1437003 - Allow H264 level up to 5.2 inclusive. r?padenot MozReview-Commit-ID: KiwVH9BUGrV
dom/media/mp4/MP4Decoder.cpp
--- a/dom/media/mp4/MP4Decoder.cpp
+++ b/dom/media/mp4/MP4Decoder.cpp
@@ -24,20 +24,22 @@ IsWhitelistedH264Codec(const nsAString& 
   }
 
   // Just assume what we can play on all platforms the codecs/formats that
   // WMF can play, since we don't have documentation about what other
   // platforms can play... According to the WMF documentation:
   // http://msdn.microsoft.com/en-us/library/windows/desktop/dd797815%28v=vs.85%29.aspx
   // "The Media Foundation H.264 video decoder is a Media Foundation Transform
   // that supports decoding of Baseline, Main, and High profiles, up to level
-  // 5.1.". We also report that we can play Extended profile, as there are
+  // 5.1.". We extend the limit to level 5.2, relying on the decoder to handle
+  // any potential errors, the level limit being rather arbitrary.
+  // We also report that we can play Extended profile, as there are
   // bitstreams that are Extended compliant that are also Baseline compliant.
   return level >= H264_LEVEL_1 &&
-         level <= H264_LEVEL_5_1 &&
+         level <= H264_LEVEL_5_2 &&
          (profile == H264_PROFILE_BASE ||
           profile == H264_PROFILE_MAIN ||
           profile == H264_PROFILE_EXTENDED ||
           profile == H264_PROFILE_HIGH);
 }
 
 /* static */
 bool