[vlc-commits] macosx vout: always use current bounds for picture placements, as we have custom resize constraints in ui code

David Fuhrmann git at videolan.org
Sat Jul 7 21:37:08 CEST 2012


vlc/vlc-2.0 | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Fri Jul  6 14:25:28 2012 +0200| [03cb327793ff5904646ea019ff23fd65960c93bf] | committer: David Fuhrmann

macosx vout: always use current bounds for picture placements, as we have custom resize constraints in ui code

(in particular, the parameter cfg will not always hold the right window size value)
(cherry picked from commit 7d42f68ab84fc29d1c3bc969487293c4ee6e9dcc)

Signed-off-by: David Fuhrmann <david.fuhrmann at googlemail.com>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=03cb327793ff5904646ea019ff23fd65960c93bf
---

 modules/video_output/macosx.m |   27 ++++++++++-----------------
 1 file changed, 10 insertions(+), 17 deletions(-)

diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index c648950..0f81da7 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -379,25 +379,18 @@ static int Control (vout_display_t *vd, int query, va_list ap)
                 && vout_window_SetSize (sys->embed, cfg->display.width, cfg->display.height))
                 return VLC_EGENERIC;
  
-            /* for the case that the core wants to resize below minimum window size we correct the size here
-             to ensure a centered picture */
+            /* we always use our current frame here, because we have some size constraints 
+               in the ui vout provider */
             vout_display_cfg_t cfg_tmp = *cfg;
-            if (cfg_tmp.display.width < windowMinSize.width)
-                cfg_tmp.display.width = windowMinSize.width;
-            if (cfg_tmp.display.height < 70)
-                cfg_tmp.display.height = 70;
+            NSRect bounds;
+            /* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */
+            if (OSX_LION)
+                bounds = [sys->glView convertRectToBacking:[sys->glView bounds]];
+            else
+                bounds = [sys->glView bounds];
+            cfg_tmp.display.width = bounds.size.width;
+            cfg_tmp.display.height = bounds.size.height;
 
-            if (!config_GetInt(vd, "macosx-video-autoresize"))
-            {
-                NSRect bounds;
-                /* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */
-                if (OSX_LION)
-                    bounds = [sys->glView convertRectToBacking:[sys->glView bounds]];
-                else
-                    bounds = [sys->glView bounds];
-                cfg_tmp.display.width = bounds.size.width;
-                cfg_tmp.display.height = bounds.size.height;
-            }
             vout_display_place_t place;
             vout_display_PlacePicture (&place, source, &cfg_tmp, false);
             @synchronized (sys->glView) {



More information about the vlc-commits mailing list