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

Steve Lhomme robux4 at ycbcr.xyz
Wed Aug 26 13:55:30 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           | 11 ++++-------
 modules/video_output/opengl/display.c   | 13 +++++--------
 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, 49 insertions(+), 81 deletions(-)

diff --git a/modules/hw/mmal/vout.c b/modules/hw/mmal/vout.c
index e0eeeb0513b..4534a281012 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 5963be63718..60916964110 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_display_PlacePicture(&place, src, vd->cfg);
 
         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_display_PlacePicture(&place, &vd->source, vd->cfg);
         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 b5821465651..956b0b64036 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 80b75147c7e..87a0787aa72 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 185e8269600..994035aa713 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 18c21534454..e617ce5b2e6 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -350,16 +350,13 @@ 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_display_PlaceFlipVertical(cfg, &place);
+                vout_display_PlacePicture(&place, &vd->source, vd->cfg);
+                vout_display_PlaceFlipVertical(vd->cfg, &place);
                 @synchronized (sys->glView) {
-                    sys->cfg = *cfg;
+                    sys->cfg = *vd->cfg;
                 }
 
                 if (vlc_gl_MakeCurrent (sys->gl) != VLC_SUCCESS)
@@ -371,7 +368,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->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 fa08c08be01..0b00ce8b42a 100644
--- a/modules/video_output/opengl/display.c
+++ b/modules/video_output/opengl/display.c
@@ -221,23 +221,20 @@ static int Control (vout_display_t *vd, int query, va_list ap)
       case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
       case VOUT_DISPLAY_CHANGE_ZOOM:
       {
-        const vout_display_cfg_t *cfg = va_arg(ap, const vout_display_cfg_t *);
         const video_format_t *src = &vd->source;
 
-        vout_display_PlacePicture(&sys->place, src, cfg);
-        vout_display_PlaceFlipVertical(cfg, &sys->place);
+        vout_display_PlacePicture(&sys->place, src, vd->cfg);
+        vout_display_PlaceFlipVertical(vd->cfg, &sys->place);
         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:
       {
-        const vout_display_cfg_t *cfg = va_arg(ap, const vout_display_cfg_t *);
-
-        vout_display_PlacePicture(&sys->place, &vd->source, cfg);
-        vout_display_PlaceFlipVertical(cfg, &sys->place);
+        vout_display_PlacePicture(&sys->place, &vd->source, vd->cfg);
+        vout_display_PlaceFlipVertical(vd->cfg, &sys->place);
         sys->place_changed = true;
         return VLC_SUCCESS;
       }
diff --git a/modules/video_output/vulkan/display.c b/modules/video_output/vulkan/display.c
index 226165f2838..6933c874a26 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_display_PlacePicture(&sys->place, &vd->source, vd->cfg);
         return VLC_SUCCESS;
     }
 
diff --git a/modules/video_output/wayland/shm.c b/modules/video_output/wayland/shm.c
index 77acabdd0c2..483dc0117c7 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_display_PlacePicture(&place, &vd->source, vd->cfg);
             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_display_PlacePicture(&place, &vd->source, vd->cfg);
 
                 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 110ce8ac623..6adf8daba74 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, const vout_display_cfg_t *vdcfg)
 {
     area->place_changed = false;
-    area->vdcfg = *vdcfg;
 }
 
 #if !VLC_WINSTORE_APP
@@ -52,7 +51,7 @@ void CommonInit(display_win32_area_t *area, const vout_display_cfg_t *vdcfg)
 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;
 
     /* */
@@ -63,15 +62,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;
@@ -97,7 +96,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);
@@ -136,20 +135,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 8eb48f72435..7e55d64c23a 100644
--- a/modules/video_output/win32/common.h
+++ b/modules/video_output/win32/common.h
@@ -35,8 +35,6 @@ typedef struct display_win32_area_t
     /* Coordinates of dest images (used when blitting to display) */
     vout_display_place_t  place;
     bool                  place_changed;
-
-    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 5affcf3068f..0e46733618e 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 175ea4da755..d9816aa547f 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 3d09d84fa2a..7f6a1178b36 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 c3e71933f35..0881a5546d6 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_display_PlacePicture(place, fmt, vd->cfg);
 
     /* 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 05e012f3897..0aebfd81591 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_display_PlacePicture(&place, &vd->source, vd->cfg);
 
         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