[vlc-commits] macosx: fixes aspect ratio / crop functionality in some cases

David Fuhrmann git at videolan.org
Tue Feb 7 10:33:24 CET 2012


vlc/vlc-2.0 | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Tue Feb  7 09:43:19 2012 +0100| [0d1b820c72355270b1adcf1d4b792a471669dc63] | committer: Felix Paul Kühne

macosx: fixes aspect ratio / crop functionality in some cases

With this commit the mentioned features result in an actual change, when we are in fullscreen or "macosx-video-autoresize" is false.
Furthermore, this fixes nasty flickering when normal window is changed in size while using this features.
Also this commit makes sure, that no window resize is happening in any case, when "macosx-video-autoresize" is false.

Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>
(cherry picked from commit fa7456d3cddcfc2ad238ac3102463eef84d134a6)

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

 modules/video_output/macosx.m |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index 0334ef1..e32ad4f 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -331,16 +331,19 @@ static int Control (vout_display_t *vd, int query, va_list ap)
             [[sys->glView window] performSelectorOnMainThread:@selector(zoom:) withObject: nil waitUntilDone:NO];
             return VLC_SUCCESS;
         }
-        case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
         case VOUT_DISPLAY_CHANGE_ZOOM:
         case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
         case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
         {
-            if (query == VOUT_DISPLAY_CHANGE_DISPLAY_SIZE)
-            {
-                if (!config_GetInt( vd, "macosx-video-autoresize" ))
-                    return VLC_SUCCESS;
-            }
+            return VLC_SUCCESS;
+        }
+            case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
+        {
+            [sys->glView performSelectorOnMainThread:@selector(reshapeView:) withObject:nil waitUntilDone:NO];
+
+            if (!config_GetInt( vd, "macosx-video-autoresize" ))
+                return VLC_SUCCESS;
+
             NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
             NSPoint topleftbase;
             NSPoint topleftscreen;
@@ -598,6 +601,11 @@ static void OpenglSwap(vlc_gl_t *gl)
         glClear(GL_COLOR_BUFFER_BIT);
 }
 
+- (void)reshapeView:(id)sender
+{
+    [self reshape];
+}
+
 /**
  * Method called by Cocoa when the view is resized.
  */



More information about the vlc-commits mailing list