[vlc-commits] d3d11va: fail early if we can't open D3D11 (unlikely)

Steve Lhomme git at videolan.org
Fri Nov 30 11:55:27 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Nov 30 11:47:07 2018 +0100| [402b06241eb07c8b7ac117b9be3656820623914c] | committer: Steve Lhomme

d3d11va: fail early if we can't open D3D11 (unlikely)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=402b06241eb07c8b7ac117b9be3656820623914c
---

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

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 6c6d00aae0..5684fbd8fe 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -336,6 +336,10 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
     if (unlikely(sys == NULL))
         return VLC_ENOMEM;
 
+    err = D3D11_Create( va, &sys->hd3d, false );
+    if (err != VLC_SUCCESS)
+        goto error;
+
     dx_sys = &sys->dx_sys;
 
     dx_sys->va_pool.pf_create_device           = D3dCreateDevice;
@@ -383,10 +387,6 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
         }
     }
 
-    err = D3D11_Create( va, &sys->hd3d, false );
-    if (err != VLC_SUCCESS)
-        goto error;
-
     err = directx_va_Open(va, &sys->dx_sys);
     if (err!=VLC_SUCCESS)
         goto error;



More information about the vlc-commits mailing list