[vlc-commits] vout:win32: don't use the display module without a hvideownd

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


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

vout:win32: don't use the display module without a hvideownd

That's where the video is supposed to be displayed. The module is unusable
without that. In many case the 0 value is not even checked.

It may be be 0 in external rendering, but then no HWND should be handled at all

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

 modules/video_output/win32/common.c  | 17 +++++++----------
 modules/video_output/win32/events.c  | 14 ++++++++------
 modules/video_output/win32/glwin32.c |  3 ---
 3 files changed, 15 insertions(+), 19 deletions(-)

diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 087d67e6bf..47b4804e95 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -208,18 +208,15 @@ void UpdateRects(vout_display_t *vd, vout_display_sys_win32_t *sys, bool is_forc
     {
         EventThreadUpdateSourceAndPlace(sys->event, source, &place);
 
-        if (sys->hvideownd)
+        UINT swpFlags = SWP_NOCOPYBITS | SWP_NOZORDER | SWP_ASYNCWINDOWPOS;
+        if (sys->is_first_placement)
         {
-            UINT swpFlags = SWP_NOCOPYBITS | SWP_NOZORDER | SWP_ASYNCWINDOWPOS;
-            if (sys->is_first_placement)
-            {
-                swpFlags |= SWP_SHOWWINDOW;
-                sys->is_first_placement = false;
-            }
-            SetWindowPos(sys->hvideownd, 0,
-                place.x, place.y, place.width, place.height,
-                swpFlags);
+            swpFlags |= SWP_SHOWWINDOW;
+            sys->is_first_placement = false;
         }
+        SetWindowPos(sys->hvideownd, 0,
+            place.x, place.y, place.width, place.height,
+            swpFlags);
     }
 #endif
 
diff --git a/modules/video_output/win32/events.c b/modules/video_output/win32/events.c
index ab7457753a..389a81b7fb 100644
--- a/modules/video_output/win32/events.c
+++ b/modules/video_output/win32/events.c
@@ -789,9 +789,6 @@ static int Win32VoutCreateWindow( event_thread_t *p_event )
         return VLC_EGENERIC;
     }
 
-    bool b_isProjected  = (vd->fmt.projection_mode != PROJECTION_MODE_RECTANGULAR);
-    InitGestures( p_event->hwnd, &p_event->p_gesture, b_isProjected );
-
     if( p_event->hparent )
     {
         /* We don't want the window owner to overwrite our client area */
@@ -836,9 +833,14 @@ static int Win32VoutCreateWindow( event_thread_t *p_event )
         (LPVOID)p_event );    /* send vd to WM_CREATE */
 
     if( !p_event->hvideownd )
-        msg_Warn( vd, "can't create video sub-window" );
-    else
-        msg_Dbg( vd, "created video sub-window" );
+    {
+        msg_Err( vd, "can't create video sub-window" );
+        return VLC_EGENERIC;
+    }
+    msg_Dbg( vd, "created video sub-window" );
+
+    bool b_isProjected  = (vd->fmt.projection_mode != PROJECTION_MODE_RECTANGULAR);
+    InitGestures( p_event->hwnd, &p_event->p_gesture, b_isProjected );
 
     /* Now display the window */
     ShowWindow( p_event->hwnd, SW_SHOW );
diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index 98ea9d3131..e3a1d6cecc 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -94,9 +94,6 @@ static vout_window_t *EmbedVideoWindow_Create(vout_display_t *vd)
 {
     vout_display_sys_t *sys = vd->sys;
 
-    if (!sys->sys.hvideownd)
-        return NULL;
-
     vout_window_t *wnd = vlc_object_create(vd, sizeof(vout_window_t));
     if (!wnd)
         return NULL;



More information about the vlc-commits mailing list