[vlc-commits] vout:win32: don't create any HWND if we have no vout_window_t

Steve Lhomme git at videolan.org
Tue Apr 2 16:32:44 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Apr  2 11:49:28 2019 +0200| [580ec07d0ce8b5e519459ac36584b847c211bbb1] | committer: Steve Lhomme

vout:win32: don't create any HWND if we have no vout_window_t

If we don't even have a dummy parent there's something very wrong.

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

 modules/video_output/win32/common.c | 8 +++-----
 modules/video_output/win32/common.h | 1 -
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 266b970217..1c2df69230 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -79,6 +79,9 @@ static bool GetWindowDimensions(void *opaque, UINT *width, UINT *height)
 /* */
 int CommonInit(vout_display_t *vd, display_win32_area_t *area, vout_display_sys_win32_t *sys)
 {
+    if (unlikely(area->vdcfg.window == NULL))
+        return VLC_EGENERIC;
+
 #if !defined(NDEBUG) && defined(HAVE_DXGIDEBUG_H)
     sys->dxgidebug_dll = LoadLibrary(TEXT("DXGIDEBUG.DLL"));
 #endif
@@ -116,7 +119,6 @@ int CommonInit(vout_display_t *vd, display_win32_area_t *area, vout_display_sys_
     if (EventThreadStart(sys->event, &hwnd, &cfg))
         return VLC_EGENERIC;
 
-    sys->parent_window = hwnd.parent_window;
     sys->hparent       = hwnd.hparent;
     sys->hwnd          = hwnd.hwnd;
     sys->hvideownd     = hwnd.hvideownd;
@@ -274,10 +276,6 @@ static int CommonControlSetFullscreen(vlc_object_t *obj, vout_display_sys_win32_
 #endif
 
     /* */
-    if (sys->parent_window)
-        return VLC_EGENERIC;
-
-    /* */
     HWND hwnd = sys->hparent && sys->hfswnd ? sys->hfswnd : sys->hwnd;
 
     /* Save the current windows placement/placement to restore
diff --git a/modules/video_output/win32/common.h b/modules/video_output/win32/common.h
index 5053d7fab6..74000a51b7 100644
--- a/modules/video_output/win32/common.h
+++ b/modules/video_output/win32/common.h
@@ -56,7 +56,6 @@ typedef struct vout_display_sys_win32_t
     /* */
     HWND                 hwnd;                  /* Handle of the main window */
     HWND                 hvideownd;        /* Handle of the video sub-window */
-    struct vout_window_t *parent_window;         /* Parent window VLC object */
     HWND                 hparent;             /* Handle of the parent window */
     HWND                 hfswnd;          /* Handle of the fullscreen window */
 



More information about the vlc-commits mailing list