[vlc-commits] [Git][videolan/vlc][master] 2 commits: vout: win32: do not return errors when CommonControl fails

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Thu May 26 13:44:30 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
7696d313 by Steve Lhomme at 2022-05-26T13:27:24+00:00
vout: win32: do not return errors when CommonControl fails

We do not handle the reset_pictures callback so we can't return an error
here. We never returned one anyway.

- - - - -
269ac301 by Steve Lhomme at 2022-05-26T13:27:24+00:00
vout: win32: simplify CommonControl

- - - - -


6 changed files:

- modules/video_output/win32/common.c
- modules/video_output/win32/common.h
- modules/video_output/win32/direct3d11.cpp
- modules/video_output/win32/direct3d9.c
- modules/video_output/win32/glwin32.c
- modules/video_output/win32/wingdi.c


Changes:

=====================================
modules/video_output/win32/common.c
=====================================
@@ -126,19 +126,12 @@ void CommonWindowClean(vout_display_sys_win32_t *sys)
 }
 #endif /* !VLC_WINSTORE_APP */
 
-int CommonControl(vout_display_t *vd, display_win32_area_t *area, vout_display_sys_win32_t *sys, int query)
+void CommonControl(vout_display_t *vd, display_win32_area_t *area, vout_display_sys_win32_t *sys, int query)
 {
     switch (query) {
-    case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
-    case VOUT_DISPLAY_CHANGE_ZOOM:
-    case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
-    case VOUT_DISPLAY_CHANGE_SOURCE_CROP: {
-        CommonPlacePicture(vd, area);
-        return VLC_SUCCESS;
-    }
     case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
-    {   /* Update dimensions */
 #ifndef VLC_WINSTORE_APP
+        // Update dimensions
         if (sys->event != NULL)
         {
             RECT clientRect;
@@ -149,11 +142,15 @@ int CommonControl(vout_display_t *vd, display_win32_area_t *area, vout_display_s
                          RECTHeight(clientRect), SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE);
         }
 #endif /* !VLC_WINSTORE_APP */
+        // fallthrough
+    case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
+    case VOUT_DISPLAY_CHANGE_ZOOM:
+    case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
+    case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
         CommonPlacePicture(vd, area);
-        return VLC_SUCCESS;
-    }
+        break;
 
     default:
-        return VLC_EGENERIC;
+        vlc_assert_unreachable();
     }
 }


=====================================
modules/video_output/win32/common.h
=====================================
@@ -73,7 +73,7 @@ int  CommonWindowInit(vout_display_t *, display_win32_area_t *, vout_display_sys
                       bool projection_gestures);
 void CommonWindowClean(vout_display_sys_win32_t *);
 #endif /* !VLC_WINSTORE_APP */
-int  CommonControl(vout_display_t *, display_win32_area_t *, vout_display_sys_win32_t *, int );
+void CommonControl(vout_display_t *, display_win32_area_t *, vout_display_sys_win32_t *, int );
 
 void CommonPlacePicture (vout_display_t *, display_win32_area_t *);
 


=====================================
modules/video_output/win32/direct3d11.cpp
=====================================
@@ -466,7 +466,7 @@ static void Close(vout_display_t *vd)
 static int Control(vout_display_t *vd, int query)
 {
     vout_display_sys_t *sys = static_cast<vout_display_sys_t *>(vd->sys);
-    int res = CommonControl( vd, &sys->area, &sys->sys, query );
+    CommonControl( vd, &sys->area, &sys->sys, query );
 
     if ( sys->area.place_changed )
     {
@@ -474,7 +474,7 @@ static int Control(vout_display_t *vd, int query)
         sys->area.place_changed =false;
     }
 
-    return res;
+    return VLC_SUCCESS;
 }
 
 static bool SelectRenderPlane(void *opaque, size_t plane, ID3D11RenderTargetView **targetView)


=====================================
modules/video_output/win32/direct3d9.c
=====================================
@@ -1682,7 +1682,8 @@ static void Direct3D9Close(vout_display_t *vd)
 static int Control(vout_display_t *vd, int query)
 {
     vout_display_sys_t *sys = vd->sys;
-    return CommonControl(vd, &sys->area, &sys->sys, query);
+    CommonControl(vd, &sys->area, &sys->sys, query);
+    return VLC_SUCCESS;
 }
 
 typedef struct


=====================================
modules/video_output/win32/glwin32.c
=====================================
@@ -84,7 +84,8 @@ static int SetViewpoint(vout_display_t *vd, const vlc_viewpoint_t *vp)
 static int Control(vout_display_t *vd, int query)
 {
     vout_display_sys_t *sys = vd->sys;
-    return CommonControl(vd, &sys->area, &sys->sys, query);
+    CommonControl(vd, &sys->area, &sys->sys, query);
+    return VLC_SUCCESS;
 }
 
 static const struct vlc_window_operations embedVideoWindow_Ops =


=====================================
modules/video_output/win32/wingdi.c
=====================================
@@ -99,7 +99,8 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
 static int Control(vout_display_t *vd, int query)
 {
     vout_display_sys_t *sys = vd->sys;
-    return CommonControl(vd, &sys->area, &sys->sys, query);
+    CommonControl(vd, &sys->area, &sys->sys, query);
+    return VLC_SUCCESS;
 }
 
 static const struct vlc_display_operations ops = {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/2fe4871ba33d3b3b7d7bf38c2a4be80c517d70d6...269ac301c93d9fc3ba6f79ec375e6d0fb48bd449

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/2fe4871ba33d3b3b7d7bf38c2a4be80c517d70d6...269ac301c93d9fc3ba6f79ec375e6d0fb48bd449
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list