From b697e5618bf341b27a065f9bdefeab78db7ae7dd Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Wed, 13 Dec 2017 16:33:37 +0100 Subject: [PATCH] d3d11va: use the internal surface size after the alignment has been applied Signed-off-by: Jean-Baptiste Kempf --- 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.11.4.GIT