[vlc-commits] d3d11va: set the mutex value no matter what

Steve Lhomme git at videolan.org
Mon Aug 1 10:00:45 CEST 2016


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Mon Aug  1 09:23:51 2016 +0200| [717bb3140ad7de452aa88a3cf4550eab3007cdc2] | committer: Jean-Baptiste Kempf

d3d11va: set the mutex value no matter what

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

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

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 294587d..edf09b2 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -449,10 +449,9 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
             HANDLE context_lock = INVALID_HANDLE_VALUE;
             UINT dataSize = sizeof(context_lock);
             hr = ID3D11Device_GetPrivateData((ID3D11Device*)dx_sys->d3ddev, &GUID_CONTEXT_MUTEX, &dataSize, &context_lock);
-            if (SUCCEEDED(hr))
-                sys->context_mutex = context_lock;
-            else
+            if (FAILED(hr))
                 msg_Warn(va, "No mutex found to lock the decoder");
+            sys->context_mutex = context_lock;
 #endif
 
             sys->d3dctx = p_sys->context;



More information about the vlc-commits mailing list