[vlc-devel] [PATCH 2/4] d3d11va: use the internal surface size after the alignment has been applied

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


---
 modules/codec/avcodec/d3d11va.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 333cd641f5..fb5bb22c31 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -368,11 +368,6 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
             va->sys->totalTextureSlices = dstDesc.ArraySize;
         }
     }
-    if (!va->sys->textureWidth || !va->sys->textureHeight)
-    {
-        va->sys->textureWidth  = fmt->video.i_width;
-        va->sys->textureHeight = fmt->video.i_height;
-    }
 
     err = D3D11_Create( va, &sys->hd3d );
     if (err != VLC_SUCCESS)
@@ -685,6 +680,12 @@ static int DxCreateDecoderSurfaces(vlc_va_t *va, int codec_id,
         ID3D10Multithread_Release(pMultithread);
     }
 
+    if (!sys->textureWidth || !sys->textureHeight)
+    {
+        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 */
-- 
2.14.2



More information about the vlc-devel mailing list