Backed out changeset 57ab4c51c72b (bug 1397141)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 13 Sep 2017 09:25:50 +0200
changeset 430006 cfd81199cbcc71b460f07fbfe745628732811996
parent 430005 c59fd8f64b53ad036b2e7e56096ce270223f3668
child 430007 e41374eb94ec940ddbafbd04af329d7035de044a
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)
bugs1397141
milestone57.0a1
backs out57ab4c51c72bfd1f0ff88d2c9a113938b5012447
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
Backed out changeset 57ab4c51c72b (bug 1397141)
dom/media/platforms/wmf/WMFVideoMFTManager.cpp
--- a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
+++ b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
@@ -558,26 +558,35 @@ WMFVideoMFTManager::InitializeDXVA()
 MediaResult
 WMFVideoMFTManager::ValidateVideoInfo()
 {
   if (mStreamType != H264 ||
       gfxPrefs::PDMWMFAllowUnsupportedResolutions()) {
     return NS_OK;
   }
 
-  // The WMF H.264 decoder is documented to have a minimum resolution 48x48 pixels
-  // for resolution, but we won't enable hw decoding for the resolution < 132 pixels.
-  // It's assumed the software decoder doesn't have this limitation, but it still
-  // might have maximum resolution limitation.
+  // The WMF H.264 decoder is documented to have a minimum resolution
+  // 48x48 pixels. We've observed the decoder working for output smaller than
+  // that, but on some output it hangs in IMFTransform::ProcessOutput(), so
+  // we just reject streams which are less than the documented minimum.
   // https://msdn.microsoft.com/en-us/library/windows/desktop/dd797815(v=vs.85).aspx
   const bool Is4KCapable = IsWin8OrLater() || IsWin7H264Decoder4KCapable();
   static const int32_t MIN_H264_FRAME_DIMENSION = 48;
   static const int32_t MAX_H264_FRAME_WIDTH = Is4KCapable ? 4096 : 1920;
   static const int32_t MAX_H264_FRAME_HEIGHT = Is4KCapable ? 2304 : 1088;
 
+  if (mStreamType == H264 &&
+      (mVideoInfo.mImage.width < MIN_H264_FRAME_DIMENSION ||
+       mVideoInfo.mImage.height < MIN_H264_FRAME_DIMENSION)) {
+    mIsValid = false;
+    return MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
+                       RESULT_DETAIL("Can't decode H.264 stream with width or "
+                                     "height less than 48 pixels."));
+  }
+
   if (mVideoInfo.mImage.width > MAX_H264_FRAME_WIDTH  ||
       mVideoInfo.mImage.height > MAX_H264_FRAME_HEIGHT) {
     mIsValid = false;
     return MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
                        RESULT_DETAIL("Can't decode H.264 stream because its "
                                      "resolution is out of the maximum limitation"));
   }