[vlc-devel] [PATCH 4/4] d3d11va: do the Xbox size check after the texture dimensions are definitive

Steve Lhomme robux4 at videolabs.io
Wed Dec 13 16:33:39 CET 2017


---
 modules/codec/avcodec/d3d11va.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 133f29d8ee..0fb16efb8e 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -686,26 +686,26 @@ static int DxCreateDecoderSurfaces(vlc_va_t *va, int codec_id,
         sys->textureHeight = fmt->i_height;
     }
 
+    if ((sys->textureWidth != fmt->i_width || sys->textureHeight != fmt->i_height) &&
+        !CanUseDecoderPadding(sys))
+    {
+        msg_Dbg(va, "mismatching external pool sizes use the internal one %dx%d vs %dx%d",
+                sys->textureWidth, sys->textureHeight, fmt->i_width, fmt->i_height);
+        dx_sys->can_extern_pool = false;
+        sys->textureWidth  = fmt->i_width;
+        sys->textureHeight = fmt->i_height;
+    }
 #if VLC_WINSTORE_APP
     /* On the Xbox 1/S, any decoding of H264 with one dimension over 2304
      * crashes totally the device */
     if (codec_id == AV_CODEC_ID_H264 &&
-        (fmt->i_width > 2304 || fmt->i_height > 2304) &&
+        (sys->textureWidth > 2304 || sys->textureHeight > 2304) &&
         isXboxHardware(sys->d3d_dev.d3ddevice))
     {
         msg_Warn(va, "%dx%d resolution not supported by your hardware", fmt->i_width, fmt->i_height);
         return VLC_EGENERIC;
     }
 #endif
-    if ((sys->textureWidth != fmt->i_width || sys->textureHeight != fmt->i_height) &&
-        !CanUseDecoderPadding(sys))
-    {
-        msg_Dbg(va, "mismatching external pool sizes use the internal one %dx%d vs %dx%d",
-                sys->textureWidth, sys->textureHeight, fmt->i_width, fmt->i_height);
-        dx_sys->can_extern_pool = false;
-        sys->textureWidth  = fmt->i_width;
-        sys->textureHeight = fmt->i_height;
-    }
 
     D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc;
     ZeroMemory(&viewDesc, sizeof(viewDesc));
-- 
2.14.2



More information about the vlc-devel mailing list