[vlc-commits] glsurface: pass actual initial window size

Rémi Denis-Courmont git at videolan.org
Thu Jan 31 19:00:07 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jan 31 19:33:38 2019 +0200| [83cb888e96b6e41bcc3a7f6cce02a334fe7561d7] | committer: Rémi Denis-Courmont

glsurface: pass actual initial window size

...rather than the intended window size. This makes the initial resize
call unnecessary.

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

 src/video_output/opengl.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/video_output/opengl.c b/src/video_output/opengl.c
index 2f684323b7..fc521cb438 100644
--- a/src/video_output/opengl.c
+++ b/src/video_output/opengl.c
@@ -172,13 +172,21 @@ vlc_gl_t *vlc_gl_surface_Create(vlc_object_t *obj,
         .display = { .width = cfg->width, cfg->height },
     };
 
+    vlc_mutex_lock(&sys->lock);
+    if (sys->width >= 0 && sys->height >= 0) {
+        dcfg.display.width = sys->width;
+        dcfg.display.height = sys->height;
+        sys->width = -1;
+        sys->height = -1;
+    }
+    vlc_mutex_unlock(&sys->lock);
+
     vlc_gl_t *gl = vlc_gl_Create(&dcfg, VLC_OPENGL, NULL);
     if (gl == NULL) {
         vout_window_Delete(surface);
         goto error;
     }
 
-    vlc_gl_Resize(gl, cfg->width, cfg->height);
     return gl;
 
 error:



More information about the vlc-commits mailing list