vlc | branch: master | David Fuhrmann <[email protected]> | Tue Feb 
 7 09:43:19 2012 +0100| [fa7456d3cddcfc2ad238ac3102463eef84d134a6] | 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 <[email protected]>

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

 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 81a8de8..3778e30 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.
  */

_______________________________________________
vlc-commits mailing list
[email protected]
http://mailman.videolan.org/listinfo/vlc-commits

Reply via email to