[vlc-devel] [PATCH 18/20] display: opengl: use precomputed vd->place directly in VOUT_DISPLAY_CHANGE_xxx

Steve Lhomme robux4 at ycbcr.xyz
Tue Aug 25 09:30:06 CEST 2020


---
 modules/video_output/macosx.m         | 11 +++++------
 modules/video_output/opengl/display.c |  4 ++--
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index e1917dde31f..68536636f9b 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -355,23 +355,22 @@ static int Control (vout_display_t *vd, int query, va_list ap)
             case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
             case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
             {
-                vout_display_place_t place;
-                vout_display_PlacePicture(&place, &vd->source, vd->cfg);
+                const vout_display_place_t *place = vd->place;
                 @synchronized (sys->glView) {
                     sys->cfg = *vd->cfg;
                 }
 
                 if (vlc_gl_MakeCurrent (sys->gl) != VLC_SUCCESS)
                     return VLC_SUCCESS;
-                vout_display_opengl_SetWindowAspectRatio(sys->vgl, (float)place.width / place.height);
+                vout_display_opengl_SetWindowAspectRatio(sys->vgl, (float)place->width / place->height);
 
                 /* For resize, we call glViewport in reshape and not here.
                  This has the positive side effect that we avoid erratic sizing as we animate every resize. */
                 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,
-                                                 vd->cfg->display.height - (place.y + place.height),
-                                                 place.width, place.height);
+                    vout_display_opengl_Viewport(sys->vgl, place->x,
+                                                 vd->cfg->display.height - (place->y + place->height),
+                                                 place->width, place->height);
                 vlc_gl_ReleaseCurrent (sys->gl);
 
                 return VLC_SUCCESS;
diff --git a/modules/video_output/opengl/display.c b/modules/video_output/opengl/display.c
index a5738310531..95c63b1f2cf 100644
--- a/modules/video_output/opengl/display.c
+++ b/modules/video_output/opengl/display.c
@@ -227,7 +227,7 @@ 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_PlacePicture(&sys->place, &vd->source, vd->cfg);
+        sys->place = *vd->place;
         sys->place_changed = true;
         vlc_gl_Resize (sys->gl, vd->cfg->display.width, vd->cfg->display.height);
         return VLC_SUCCESS;
@@ -236,7 +236,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:
       {
-        vout_display_PlacePicture(&sys->place, &vd->source, vd->cfg);
+        sys->place = *vd->place;
         sys->place_changed = true;
         return VLC_SUCCESS;
       }
-- 
2.26.2



More information about the vlc-devel mailing list