[vlc-devel] [PATCH v2 03/19] display: use vd->cfg directly in VOUT_DISPLAY_CHANGE_xxx/RESET_PICTURES

Steve Lhomme robux4 at ycbcr.xyz
Tue Aug 25 16:20:16 CEST 2020


No need to pass a const on a value we already have access to.

Don't keep a local copy of the display configuration.
---
 modules/hw/mmal/vout.c                  |  3 +--
 modules/hw/vdpau/display.c              |  7 +++----
 modules/video_output/android/display.c  |  6 ++----
 modules/video_output/caopengllayer.m    |  4 +---
 modules/video_output/ios.m              |  7 +------
 modules/video_output/kva.c              |  6 ++----
 modules/video_output/macosx.m           |  9 +++------
 modules/video_output/opengl/display.c   |  6 +++---
 modules/video_output/vulkan/display.c   |  3 +--
 modules/video_output/wayland/shm.c      | 11 +++++------
 modules/video_output/win32/common.c     | 15 +++++----------
 modules/video_output/win32/common.h     |  2 --
 modules/video_output/win32/direct3d11.c | 12 ++++++------
 modules/video_output/win32/direct3d9.c  |  8 ++++----
 modules/video_output/win32/wingdi.c     |  4 ++--
 modules/video_output/xcb/render.c       | 15 ++++++---------
 modules/video_output/xcb/x11.c          |  3 +--
 17 files changed, 46 insertions(+), 75 deletions(-)

diff --git a/modules/hw/mmal/vout.c b/modules/hw/mmal/vout.c
index 6d4c8a2c7c5..c10fc54a14a 100644
--- a/modules/hw/mmal/vout.c
+++ b/modules/hw/mmal/vout.c
@@ -702,8 +702,7 @@ static int vd_control(vout_display_t *vd, int query, va_list args)
     switch (query) {
         case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
         {
-            const vout_display_cfg_t *cfg = va_arg(args, const vout_display_cfg_t *);
-            if (configure_display(vd, cfg, NULL) >= 0)
+            if (configure_display(vd, vd->cfg, NULL) >= 0)
                 ret = VLC_SUCCESS;
             break;
         }
diff --git a/modules/hw/vdpau/display.c b/modules/hw/vdpau/display.c
index 61d4c1a1430..473cb220b09 100644
--- a/modules/hw/vdpau/display.c
+++ b/modules/hw/vdpau/display.c
@@ -231,13 +231,13 @@ static int Control(vout_display_t *vd, int query, va_list ap)
     {
     case VOUT_DISPLAY_RESET_PICTURES:
     {
-        const vout_display_cfg_t *cfg = va_arg(ap, const vout_display_cfg_t *);
+        va_arg(ap, const vout_display_cfg_t *);
         video_format_t *fmt = va_arg(ap, video_format_t *);
         const video_format_t *src= &vd->source;
         vout_display_place_t place;
 
         msg_Dbg(vd, "resetting pictures");
-        vout_display_PlacePicture(&place, src, cfg, VOUT_ORIGIN_TOP_LEFT);
+        vout_display_PlacePicture(&place, src, vd->cfg, VOUT_ORIGIN_TOP_LEFT);
 
         fmt->i_width = src->i_width * place.width / src->i_visible_width;
         fmt->i_height = src->i_height * place.height / src->i_visible_height;
@@ -256,10 +256,9 @@ static int Control(vout_display_t *vd, int query, va_list ap)
     }
     case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
     {
-        const vout_display_cfg_t *cfg = va_arg(ap, const vout_display_cfg_t *);
         vout_display_place_t place;
 
-        vout_display_PlacePicture(&place, &vd->source, cfg, VOUT_ORIGIN_TOP_LEFT);
+        vout_display_PlacePicture(&place, &vd->source, vd->cfg, VOUT_ORIGIN_TOP_LEFT);
         if (place.width  != vd->fmt.i_visible_width
          || place.height != vd->fmt.i_visible_height)
             return VLC_EGENERIC;
diff --git a/modules/video_output/android/display.c b/modules/video_output/android/display.c
index ba7947b7624..0b849b7f0f7 100644
--- a/modules/video_output/android/display.c
+++ b/modules/video_output/android/display.c
@@ -916,10 +916,8 @@ static int Control(vout_display_t *vd, int query, va_list args)
     }
     case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
     {
-        const vout_display_cfg_t *cfg = va_arg(args, const vout_display_cfg_t *);
-
-        sys->i_display_width = cfg->display.width;
-        sys->i_display_height = cfg->display.height;
+        sys->i_display_width = vd->cfg->display.width;
+        sys->i_display_height = vd->cfg->display.height;
         msg_Dbg(vd, "change display size: %dx%d", sys->i_display_width,
                                                   sys->i_display_height);
         FixSubtitleFormat(sys);
diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m
index 3eeaba0ce10..3da36463b67 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -308,11 +308,9 @@ static int Control (vout_display_t *vd, int query, va_list ap)
         case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
         case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
         {
-            const vout_display_cfg_t *cfg =
-                va_arg (ap, const vout_display_cfg_t *);
 
             /* we always use our current frame here */
-            vout_display_cfg_t cfg_tmp = *cfg;
+            vout_display_cfg_t cfg_tmp = *vd->cfg;
             [CATransaction lock];
             CGRect bounds = [sys->cgLayer visibleRect];
             [CATransaction unlock];
diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m
index 771cbbb649e..82b0b04c042 100644
--- a/modules/video_output/ios.m
+++ b/modules/video_output/ios.m
@@ -261,12 +261,7 @@ static int Control(vout_display_t *vd, int query, va_list ap)
         case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
         case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
         {
-            const vout_display_cfg_t *cfg =
-                va_arg(ap, const vout_display_cfg_t *);
-
-            assert(cfg);
-
-            [sys->glESView updateVoutCfg:cfg withVGL:glsys->vgl];
+            [sys->glESView updateVoutCfg:vd->cfg withVGL:glsys->vgl];
 
             return VLC_SUCCESS;
         }
diff --git a/modules/video_output/kva.c b/modules/video_output/kva.c
index 09d5fcf8add..ec8b4be93cf 100644
--- a/modules/video_output/kva.c
+++ b/modules/video_output/kva.c
@@ -420,11 +420,9 @@ static int Control( vout_display_t *vd, int query, va_list args )
 
     case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
     {
-        const vout_display_cfg_t *cfg = va_arg(args, const vout_display_cfg_t *);
-
         WinPostMsg( sys->client, WM_VLC_SIZE_CHANGE,
-                    MPFROMLONG( cfg->display.width ),
-                    MPFROMLONG( cfg->display.height ));
+                    MPFROMLONG( vd->cfg->display.width ),
+                    MPFROMLONG( vd->cfg->display.height ));
         return VLC_SUCCESS;
     }
 
diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index 12d18ab842f..6ff16488989 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -350,15 +350,12 @@ static int Control (vout_display_t *vd, int query, va_list ap)
             case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
             case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
             {
-                const vout_display_cfg_t *cfg =
-                    va_arg (ap, const vout_display_cfg_t *);
-
                 /* we always use our current frame here, because we have some size constraints
                  in the ui vout provider */
                 vout_display_place_t place;
-                vout_display_PlacePicture(&place, &vd->source, cfg, VOUT_ORIGIN_BOTTOM_LEFT);
+                vout_display_PlacePicture(&place, &vd->source, vd->cfg, VOUT_ORIGIN_BOTTOM_LEFT);
                 @synchronized (sys->glView) {
-                    sys->cfg = *cfg;
+                    sys->cfg = *vd->cfg;
                 }
 
                 if (vlc_gl_MakeCurrent (sys->gl) != VLC_SUCCESS)
@@ -370,7 +367,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
                 if (query != VOUT_DISPLAY_CHANGE_DISPLAY_SIZE)
                     // x / y are top left corner, but we need the lower left one
                     vout_display_opengl_Viewport(sys->vgl, place.x,
-                                                 cfg_tmp.display.height - (place.y + place.height),
+                                                 vd->cfg->display.height - (place.y + place.height),
                                                  place.width, place.height);
                 vlc_gl_ReleaseCurrent (sys->gl);
 
diff --git a/modules/video_output/opengl/display.c b/modules/video_output/opengl/display.c
index fae920dd6ec..58f0cdc388f 100644
--- a/modules/video_output/opengl/display.c
+++ b/modules/video_output/opengl/display.c
@@ -221,19 +221,19 @@ static int Control (vout_display_t *vd, int query, va_list ap)
       case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
       case VOUT_DISPLAY_CHANGE_ZOOM:
       {
-        vout_display_cfg_t cfg = *va_arg(ap, const vout_display_cfg_t *);
+        vout_display_cfg_t cfg = *vd->cfg;
         const video_format_t *src = &vd->source;
 
         vout_display_PlacePicture(&sys->place, src, &cfg, VOUT_ORIGIN_BOTTOM_LEFT);
         sys->place_changed = true;
-        vlc_gl_Resize (sys->gl, cfg.display.width, cfg.display.height);
+        vlc_gl_Resize (sys->gl, vd->cfg->display.width, vd->cfg->display.height);
         return VLC_SUCCESS;
       }
 
       case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
       case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
       {
-        vout_display_cfg_t cfg = *va_arg(ap, const vout_display_cfg_t *);
+        vout_display_cfg_t cfg = *vd->cfg;
 
         vout_display_PlacePicture(&sys->place, &vd->source, &cfg, VOUT_ORIGIN_BOTTOM_LEFT);
         sys->place_changed = true;
diff --git a/modules/video_output/vulkan/display.c b/modules/video_output/vulkan/display.c
index 119583d1379..302ed0be00f 100644
--- a/modules/video_output/vulkan/display.c
+++ b/modules/video_output/vulkan/display.c
@@ -347,8 +347,7 @@ static int Control(vout_display_t *vd, int query, va_list ap)
     case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
     case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
     case VOUT_DISPLAY_CHANGE_ZOOM: {
-        vout_display_cfg_t cfg = *va_arg (ap, const vout_display_cfg_t *);
-        vout_display_PlacePicture(&sys->place, &vd->source, &cfg, VOUT_ORIGIN_TOP_LEFT);
+        vout_display_PlacePicture(&sys->place, &vd->source, vd->cfg, VOUT_ORIGIN_TOP_LEFT);
         return VLC_SUCCESS;
     }
 
diff --git a/modules/video_output/wayland/shm.c b/modules/video_output/wayland/shm.c
index 811682b8f96..72194520cca 100644
--- a/modules/video_output/wayland/shm.c
+++ b/modules/video_output/wayland/shm.c
@@ -160,13 +160,13 @@ static int Control(vout_display_t *vd, int query, va_list ap)
     {
         case VOUT_DISPLAY_RESET_PICTURES:
         {
-            const vout_display_cfg_t *cfg = va_arg(ap, const vout_display_cfg_t *);
+            va_arg(ap, const vout_display_cfg_t *);
             video_format_t *fmt = va_arg(ap, video_format_t *);
             vout_display_place_t place;
             video_format_t src;
             assert(sys->viewport == NULL);
 
-            vout_display_PlacePicture(&place, &vd->source, cfg, VOUT_ORIGIN_TOP_LEFT);
+            vout_display_PlacePicture(&place, &vd->source, vd->cfg, VOUT_ORIGIN_TOP_LEFT);
             video_format_ApplyRotation(&src, &vd->source);
 
             fmt->i_width  = src.i_width * place.width
@@ -188,9 +188,8 @@ static int Control(vout_display_t *vd, int query, va_list ap)
         case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
         case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
         {
-            const vout_display_cfg_t *cfg = va_arg(ap, const vout_display_cfg_t *);
-            sys->display_width = cfg->display.width;
-            sys->display_height = cfg->display.height;
+            sys->display_width = vd->cfg->display.width;
+            sys->display_height = vd->cfg->display.height;
 
             if (sys->viewport != NULL)
             {
@@ -198,7 +197,7 @@ static int Control(vout_display_t *vd, int query, va_list ap)
                 vout_display_place_t place;
 
                 video_format_ApplyRotation(&fmt, &vd->source);
-                vout_display_PlacePicture(&place, &vd->source, cfg, VOUT_ORIGIN_TOP_LEFT);
+                vout_display_PlacePicture(&place, &vd->source, vd->cfg, VOUT_ORIGIN_TOP_LEFT);
 
                 wp_viewport_set_source(sys->viewport,
                                 wl_fixed_from_int(fmt.i_x_offset),
diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 11ff257a3ee..3a00861821c 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -44,7 +44,6 @@
 void CommonInit(display_win32_area_t *area, enum vout_place_origin origin, const vout_display_cfg_t *vdcfg)
 {
     area->place_changed = false;
-    area->vdcfg = *vdcfg;
     area->origin = origin;
 }
 
@@ -53,7 +52,7 @@ void CommonInit(display_win32_area_t *area, enum vout_place_origin origin, const
 int CommonWindowInit(vout_display_t *vd, display_win32_area_t *area,
                      vout_display_sys_win32_t *sys, bool projection_gestures)
 {
-    if (unlikely(area->vdcfg.window == NULL))
+    if (unlikely(vd->cfg->window == NULL))
         return VLC_EGENERIC;
 
     /* */
@@ -64,15 +63,15 @@ int CommonWindowInit(vout_display_t *vd, display_win32_area_t *area,
     sys->hparent   = NULL;
 
     /* */
-    sys->event = EventThreadCreate(VLC_OBJECT(vd), area->vdcfg.window);
+    sys->event = EventThreadCreate(VLC_OBJECT(vd), vd->cfg->window);
     if (!sys->event)
         return VLC_EGENERIC;
 
     /* */
     event_cfg_t cfg;
     memset(&cfg, 0, sizeof(cfg));
-    cfg.width  = area->vdcfg.display.width;
-    cfg.height = area->vdcfg.display.height;
+    cfg.width  = vd->cfg->display.width;
+    cfg.height = vd->cfg->display.height;
     cfg.is_projected = projection_gestures;
 
     event_hwnd_t hwnd;
@@ -98,7 +97,7 @@ int CommonWindowInit(vout_display_t *vd, display_win32_area_t *area,
 void CommonPlacePicture(vout_display_t *vd, display_win32_area_t *area, vout_display_sys_win32_t *sys)
 {
     /* Update the window position and size */
-    vout_display_cfg_t place_cfg = area->vdcfg;
+    vout_display_cfg_t place_cfg = *vd->cfg;
 
     vout_display_place_t before_place = area->place;
     vout_display_PlacePicture(&area->place, &vd->source, &place_cfg, area->origin);
@@ -137,20 +136,16 @@ int CommonControl(vout_display_t *vd, display_win32_area_t *area, vout_display_s
     case VOUT_DISPLAY_CHANGE_ZOOM:           /* const vout_display_cfg_t *p_cfg */
     case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
     case VOUT_DISPLAY_CHANGE_SOURCE_CROP: {
-        area->vdcfg = *va_arg(args, const vout_display_cfg_t *);
         CommonPlacePicture(vd, area, sys);
         return VLC_SUCCESS;
     }
     case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:   /* const vout_display_cfg_t *p_cfg */
     {   /* Update dimensions */
-        area->vdcfg = *va_arg(args, const vout_display_cfg_t *);
 #if !VLC_WINSTORE_APP
         if (sys->event != NULL)
         {
             RECT clientRect;
             GetClientRect(sys->hparent, &clientRect);
-            area->vdcfg.display.width  = RECTWidth(clientRect);
-            area->vdcfg.display.height = RECTHeight(clientRect);
 
             SetWindowPos(sys->hvideownd, 0, 0, 0,
                          RECTWidth(clientRect),
diff --git a/modules/video_output/win32/common.h b/modules/video_output/win32/common.h
index 562be27bf23..2b4b1c16d72 100644
--- a/modules/video_output/win32/common.h
+++ b/modules/video_output/win32/common.h
@@ -36,8 +36,6 @@ typedef struct display_win32_area_t
     vout_display_place_t  place;
     bool                  place_changed;
     enum vout_place_origin origin;
-
-    vout_display_cfg_t    vdcfg;
 } display_win32_area_t;
 
 #define RECTWidth(r)   (LONG)((r).right - (r).left)
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 375ef67500b..08e0eea1253 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -213,8 +213,8 @@ static int QueryDisplayFormat(vout_display_t *vd, const video_format_t *fmt)
     vout_display_sys_t *sys = vd->sys;
     libvlc_video_render_cfg_t cfg;
 
-    cfg.width  = sys->area.vdcfg.display.width;
-    cfg.height = sys->area.vdcfg.display.height;
+    cfg.width  = vd->cfg->display.width;
+    cfg.height = vd->cfg->display.height;
 
     switch (fmt->i_chroma)
     {
@@ -468,7 +468,7 @@ static void SetQuadVSProjection(vout_display_t *vd, d3d_quad_t *quad, const vlc_
          f_fovx < -0.001f )
         return;
 
-    float f_sar = (float) sys->area.vdcfg.display.width / sys->area.vdcfg.display.height;
+    float f_sar = (float) vd->cfg->display.width / vd->cfg->display.height;
     float f_fovy = UpdateFOVy(f_fovx, f_sar);
     float f_z = UpdateZ(f_fovx, f_fovy);
 
@@ -689,7 +689,7 @@ static void Prepare(vout_display_t *vd, picture_t *picture,
         uint32_t i_height;
         if (LocalSwapchainWinstoreSize( sys->outside_opaque, &i_width, &i_height ))
         {
-            if (i_width != sys->area.vdcfg.display.width || i_height != sys->area.vdcfg.display.height)
+            if (i_width != vd->cfg->display.width || i_height != vd->cfg->display.height)
                 vout_display_SetSize(vd, i_width, i_height);
         }
     }
@@ -987,7 +987,7 @@ static void UpdatePicQuadPosition(vout_display_t *vd)
 
     D3D11_UpdateViewport( &sys->picQuad, &rect_dst, sys->display.pixelFormat );
 
-    SetQuadVSProjection(vd, &sys->picQuad, &sys->area.vdcfg.viewpoint);
+    SetQuadVSProjection(vd, &sys->picQuad, &vd->cfg->viewpoint);
 
 #ifndef NDEBUG
     msg_Dbg( vd, "picQuad position (%.02f,%.02f) %.02fx%.02f",
@@ -1090,7 +1090,7 @@ static int Direct3D11CreateFormatResources(vout_display_t *vd, const video_forma
 
     if ( vd->source.projection_mode == PROJECTION_MODE_EQUIRECTANGULAR ||
          vd->source.projection_mode == PROJECTION_MODE_CUBEMAP_LAYOUT_STANDARD )
-        SetQuadVSProjection( vd, &sys->picQuad, &sys->area.vdcfg.viewpoint );
+        SetQuadVSProjection( vd, &sys->picQuad, &vd->cfg->viewpoint );
 
     if (is_d3d11_opaque(fmt->i_chroma)) {
         ID3D10Multithread *pMultithread;
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 439d94cf9fc..ab07e3f3458 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -497,8 +497,8 @@ static int UpdateOutput(vout_display_t *vd, const video_format_t *fmt,
 {
     vout_display_sys_t *sys = vd->sys;
     libvlc_video_render_cfg_t cfg;
-    cfg.width  = sys->area.vdcfg.display.width;
-    cfg.height = sys->area.vdcfg.display.height;
+    cfg.width  = vd->cfg->display.width;
+    cfg.height = vd->cfg->display.height;
 
     switch (fmt->i_chroma)
     {
@@ -1262,9 +1262,9 @@ static void Swap(vout_display_t *vd)
     // No stretching should happen here !
     RECT src = {
         .left   = 0,
-        .right  = sys->area.vdcfg.display.width,
+        .right  = vd->cfg->display.width,
         .top    = 0,
-        .bottom = sys->area.vdcfg.display.height
+        .bottom = vd->cfg->display.height
     };
 
     HRESULT hr;
diff --git a/modules/video_output/win32/wingdi.c b/modules/video_output/win32/wingdi.c
index 8d55a6f0f3c..3566e9a9a0a 100644
--- a/modules/video_output/win32/wingdi.c
+++ b/modules/video_output/win32/wingdi.c
@@ -160,9 +160,9 @@ static void Display(vout_display_t *vd, picture_t *picture)
         /* clear the background */
         RECT display = {
             .left   = 0,
-            .right  = sys->area.vdcfg.display.width,
+            .right  = vd->cfg->display.width,
             .top    = 0,
-            .bottom = sys->area.vdcfg.display.height,
+            .bottom = vd->cfg->display.height,
         };
         FillRect(hdc, &display, GetStockObject(BLACK_BRUSH));
         sys->area.place_changed = false;
diff --git a/modules/video_output/xcb/render.c b/modules/video_output/xcb/render.c
index cede80fd246..4eab7a3b1df 100644
--- a/modules/video_output/xcb/render.c
+++ b/modules/video_output/xcb/render.c
@@ -265,7 +265,7 @@ static void Display(vout_display_t *vd, picture_t *pic)
     (void) pic;
 }
 
-static void CreateBuffers(vout_display_t *vd, const vout_display_cfg_t *cfg)
+static void CreateBuffers(vout_display_t *vd)
 {
     const video_format_t *fmt = &vd->source;
     vout_display_sys_t *sys = vd->sys;
@@ -274,14 +274,14 @@ static void CreateBuffers(vout_display_t *vd, const vout_display_cfg_t *cfg)
     xcb_create_pixmap(conn, 32, sys->drawable.crop, sys->root,
                       fmt->i_visible_width, fmt->i_visible_height);
     xcb_create_pixmap(conn, 32, sys->drawable.scale, sys->root,
-                      cfg->display.width, cfg->display.height);
+                      vd->cfg->display.width, vd->cfg->display.height);
     xcb_render_create_picture(conn, sys->picture.crop, sys->drawable.crop,
                               sys->format.argb, 0, NULL);
     xcb_render_create_picture(conn, sys->picture.scale, sys->drawable.scale,
                               sys->format.argb, 0, NULL);
 
     vout_display_place_t *place = &sys->place;
-    vout_display_PlacePicture(place, fmt, cfg, VOUT_ORIGIN_TOP_LEFT);
+    vout_display_PlacePicture(place, fmt, vd->cfg, VOUT_ORIGIN_TOP_LEFT);
 
     /* Homogeneous coordinates transform from destination(place)
      * to source(fmt) */
@@ -360,18 +360,15 @@ static int Control(vout_display_t *vd, int query, va_list ap)
         case VOUT_DISPLAY_CHANGE_ZOOM:
         case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
         case VOUT_DISPLAY_CHANGE_SOURCE_CROP: {
-            const vout_display_cfg_t *cfg = va_arg(ap,
-                                                   const vout_display_cfg_t *);
-
             /* Update the window size */
             uint32_t mask = XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
             const uint32_t values[] = {
-                cfg->display.width, cfg->display.height
+                vd->cfg->display.width, vd->cfg->display.height
             };
 
             xcb_configure_window(sys->conn, sys->drawable.dest, mask, values);
             DeleteBuffers(vd);
-            CreateBuffers(vd, cfg);
+            CreateBuffers(vd);
             xcb_flush(sys->conn);
             return VLC_SUCCESS;
         }
@@ -680,7 +677,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
                               sys->format.argb, 0, NULL);
     xcb_render_create_picture(conn, sys->picture.dest, sys->drawable.dest,
                               sys->format.argb, 0, NULL);
-    CreateBuffers(vd, cfg);
+    CreateBuffers(vd);
     xcb_map_window(conn, sys->drawable.dest);
 
     sys->spu_chromas[0] = fmtp->i_chroma;
diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c
index 6ea5b82d908..08daa739594 100644
--- a/modules/video_output/xcb/x11.c
+++ b/modules/video_output/xcb/x11.c
@@ -145,12 +145,11 @@ static int Control(vout_display_t *vd, int query, va_list ap)
     case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
     case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
     {
-        const vout_display_cfg_t *cfg = va_arg(ap, const vout_display_cfg_t *);
         video_format_t src, *fmt = &sys->fmt;
         vout_display_place_t place;
         int ret = VLC_SUCCESS;
 
-        vout_display_PlacePicture(&place, &vd->source, cfg, VOUT_ORIGIN_TOP_LEFT);
+        vout_display_PlacePicture(&place, &vd->source, vd->cfg, VOUT_ORIGIN_TOP_LEFT);
 
         uint32_t mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y;
         const uint32_t values[] = {
-- 
2.26.2



More information about the vlc-devel mailing list