[vlc-commits] d3d11va: do not use the external pool if it cannot be used for decoding
Steve Lhomme
git at videolan.org
Wed Oct 17 16:07:41 CEST 2018
vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jan 30 10:02:13 2018 +0100| [3ec9e83f284aa77dab627bdbc0838ab758a92175] | committer: Steve Lhomme
d3d11va: do not use the external pool if it cannot be used for decoding
(cherry picked from commit f5320b3c899d75956aee4c14805e5714f28ccc3c)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=3ec9e83f284aa77dab627bdbc0838ab758a92175
---
modules/codec/avcodec/d3d11va.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 2caf5c65e7..06428990ba 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -375,9 +375,12 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
D3D11_TEXTURE2D_DESC dstDesc;
ID3D11Texture2D_GetDesc( p_sys->texture[KNOWN_DXGI_INDEX], &dstDesc);
sys->render = dstDesc.Format;
- va->sys->textureWidth = dstDesc.Width;
- va->sys->textureHeight = dstDesc.Height;
- va->sys->totalTextureSlices = dstDesc.ArraySize;
+ if (dstDesc.BindFlags & D3D11_BIND_DECODER)
+ {
+ va->sys->textureWidth = dstDesc.Width;
+ va->sys->textureHeight = dstDesc.Height;
+ va->sys->totalTextureSlices = dstDesc.ArraySize;
+ }
}
}
@@ -656,7 +659,7 @@ static int DxSetupOutput(vlc_va_t *va, const GUID *input, const video_format_t *
}
msg_Dbg(va, "Using output format %s for decoder %s", DxgiFormatToStr(processorInput[idx]), psz_decoder_name);
- if ( sys->render == processorInput[idx] )
+ if ( sys->render == processorInput[idx] && sys->totalTextureSlices > 4)
{
if (CanUseVoutPool(&sys->d3d_dev, sys->totalTextureSlices))
dx_sys->can_extern_pool = true;
More information about the vlc-commits
mailing list