[vlc-devel] [PATCH] d3d11va: CreateVideoDecoderOutputView() shouldn't fail because of incorrect init

Steve Lhomme robux4 at videolabs.io
Tue May 2 13:52:02 CEST 2017


---
 modules/codec/avcodec/d3d11va.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index dafd3d9180..305cb0736f 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -389,6 +389,9 @@ static int Get(vlc_va_t *va, picture_t *pic, uint8_t **data)
                                                              &p_sys->decoder );
         if (FAILED(hr)) {
             msg_Warn(va, "CreateVideoDecoderOutputView %d failed. (hr=0x%0lx)", p_sys->slice_index, hr);
+            D3D11_TEXTURE2D_DESC texDesc;
+            ID3D11Texture2D_GetDesc(p_sys->texture[KNOWN_DXGI_INDEX], &texDesc);
+            assert(texDesc.BindFlags & D3D11_BIND_DECODER);
             p_sys->decoder = NULL;
         }
     }
-- 
2.12.1



More information about the vlc-devel mailing list