[vlc-commits] d3d11va: do the Xbox size check after the texture dimensions are definitive

Steve Lhomme git at videolan.org
Thu Dec 14 00:57:59 CET 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Wed Dec 13 16:33:39 2017 +0100| [067e582bd813e7d2038610df561c83afa0e6b9a0] | committer: Jean-Baptiste Kempf

d3d11va: do the Xbox size check after the texture dimensions are definitive

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=067e582bd813e7d2038610df561c83afa0e6b9a0
---

 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));



More information about the vlc-commits mailing list