[vlc-commits] vout:win32: handle WM_CAPTURECHANGED like any other message

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


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Mar 28 10:15:02 2019 +0100| [cde5b075632a87524acaa9d56a373d915d93e71e] | committer: Steve Lhomme

vout:win32: handle WM_CAPTURECHANGED like any other message

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

 modules/video_output/win32/events.c | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/modules/video_output/win32/events.c b/modules/video_output/win32/events.c
index 5ed34987b8..9144368e85 100644
--- a/modules/video_output/win32/events.c
+++ b/modules/video_output/win32/events.c
@@ -657,8 +657,9 @@ static long FAR PASCAL VideoEventProc( HWND hwnd, UINT message,
         return DefWindowProc(hwnd, message, wParam, lParam);
     event_thread_t *p_event = (event_thread_t *)p_user_data;
 
-    if( message == WM_CAPTURECHANGED )
+    switch( message )
     {
+    case WM_CAPTURECHANGED:
         for( int button = 0; p_event->button_pressed; button++ )
         {
             unsigned m = 1 << button;
@@ -668,10 +669,7 @@ static long FAR PASCAL VideoEventProc( HWND hwnd, UINT message,
         }
         p_event->button_pressed = 0;
         return 0;
-    }
 
-    switch( message )
-    {
     /*
     ** For OpenGL and Direct3D, vout will update the whole
     ** window at regular interval, therefore dirty region
@@ -964,8 +962,15 @@ static long FAR PASCAL WinVoutEventProc( HWND hwnd, UINT message,
         return DefWindowProc(hwnd, message, wParam, lParam);
     event_thread_t *p_event = (event_thread_t *)p_user_data;
 
-    if( message == WM_CAPTURECHANGED )
+    switch( message )
     {
+
+    case WM_SIZE:
+        if (!p_event->hparent)
+            atomic_store(&p_event->size_changed, true);
+        return 0;
+
+    case WM_CAPTURECHANGED:
         for( int button = 0; p_event->button_pressed; button++ )
         {
             unsigned m = 1 << button;
@@ -975,15 +980,6 @@ static long FAR PASCAL WinVoutEventProc( HWND hwnd, UINT message,
         }
         p_event->button_pressed = 0;
         return 0;
-    }
-
-    switch( message )
-    {
-
-    case WM_SIZE:
-        if (!p_event->hparent)
-            atomic_store(&p_event->size_changed, true);
-        return 0;
 
     /* the user wants to close the window */
     case WM_CLOSE:



More information about the vlc-commits mailing list