[vlc-commits] d3d11va: do not use the external pool if it cannot be used for decoding
Steve Lhomme
git at videolan.org
Thu Aug 2 13:08:08 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jan 30 10:02:13 2018 +0100| [f5320b3c899d75956aee4c14805e5714f28ccc3c] | committer: Steve Lhomme
d3d11va: do not use the external pool if it cannot be used for decoding
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f5320b3c899d75956aee4c14805e5714f28ccc3c
---
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 bd202e4392..3f2c7bb793 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -369,9 +369,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;
+ }
}
}
@@ -649,7 +652,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