[vlc-commits] [Git][videolan/vlc][3.0.x] caopengllayer: fix wrong fullscreen size

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Aug 31 12:39:57 UTC 2022



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
2d76f7dc by Marvin Scholz at 2022-08-31T12:26:15+00:00
caopengllayer: fix wrong fullscreen size

When transitioning to fullscreen, the codepath for non-live
resize was used and did not trigger rendering here.
As the size if now handled by the window however, this resulted
in a wrong size as it was never actually updated. To prevent that,
always render with the proper size from the layer regardless
if we are in live-resize or not.

Fixes #27276

(cherry picked from commit 3f012cc366ac0448cbfbecae66a6b2a31dfea518)
Signed-off-by: Marvin Scholz <epirat07 at gmail.com>

- - - - -


1 changed file:

- modules/video_output/caopengllayer.m


Changes:

=====================================
modules/video_output/caopengllayer.m
=====================================
@@ -902,25 +902,23 @@ shouldInheritContentsScale:(CGFloat)newScale
         if (vlc_gl_MakeCurrent(sys->gl))
             return;
 
-        if (self.asynchronous) {
-            GLint dims[4] = { 0, 0, 0, 0 };
-            glGetIntegerv(GL_VIEWPORT, dims);
-            NSSize newSize = NSMakeSize(dims[2], dims[3]);
-
-            if (NSEqualSizes(newSize, NSZeroSize)) {
-                newSize = self.bounds.size;
-                CGFloat scale = self.contentsScale;
-                newSize.width *= scale;
-                newSize.height *= scale;
-            }
+        GLint dims[4] = { 0, 0, 0, 0 };
+        glGetIntegerv(GL_VIEWPORT, dims);
+        NSSize newSize = NSMakeSize(dims[2], dims[3]);
+
+        if (NSEqualSizes(newSize, NSZeroSize)) {
+            newSize = self.bounds.size;
+            CGFloat scale = self.contentsScale;
+            newSize.width *= scale;
+            newSize.height *= scale;
+        }
 
-            @synchronized(sys->videoView)
-            {
-                sys->cfg.display.width = newSize.width;
-                sys->cfg.display.height = newSize.height;
+        @synchronized(sys->videoView)
+        {
+            sys->cfg.display.width = newSize.width;
+            sys->cfg.display.height = newSize.height;
 
-                vout_display_PlacePicture(&sys->place, &_voutDisplay->source, &sys->cfg, false);
-            }
+            vout_display_PlacePicture(&sys->place, &_voutDisplay->source, &sys->cfg, false);
         }
 
         // Ensure viewport and aspect ratio is correct



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/2d76f7dc422efdfc0d6c8ee920265bf1c7fc78ac

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/2d76f7dc422efdfc0d6c8ee920265bf1c7fc78ac
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