[vlc-commits] vout:wgl: do not use the window if the hwnd is not set

Steve Lhomme git at videolan.org
Mon Apr 1 12:03:30 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Apr  1 09:43:00 2019 +0200| [82456dd1f8629c919cdbe0329ee9de802e81ffee] | committer: Steve Lhomme

vout:wgl: do not use the window if the hwnd is not set

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

 modules/video_output/win32/wgl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/win32/wgl.c b/modules/video_output/win32/wgl.c
index 3bf8f1abfe..fa4f466372 100644
--- a/modules/video_output/win32/wgl.c
+++ b/modules/video_output/win32/wgl.c
@@ -171,11 +171,11 @@ static int Open(vlc_gl_t *gl, unsigned width, unsigned height)
     if (nVidiaAffinity >= 0) CreateGPUAffinityDC(gl, nVidiaAffinity);
 
     vout_window_t *wnd = gl->surface;
-    sys->sys.hvideownd = wnd->handle.hwnd;
-    if (wnd->type != VOUT_WINDOW_TYPE_HWND)
+    if (wnd->type != VOUT_WINDOW_TYPE_HWND || wnd->handle.hwnd == 0)
         goto error;
 
-    sys->hGLDC = GetDC(wnd->handle.hwnd);
+    sys->sys.hvideownd = wnd->handle.hwnd;
+    sys->hGLDC = GetDC(sys->sys.hvideownd);
     if (sys->hGLDC == NULL)
     {
         msg_Err(gl, "Could not get the device context");



More information about the vlc-commits mailing list