[vlc-devel] [PATCH 4/4] macosx: fixes aspect ratio / crop functionality in some cases
David Fuhrmann
david.fuhrmann at googlemail.com
Tue Feb 7 09:43:19 CET 2012
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.
---
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.
*/
--
1.7.5.4
More information about the vlc-devel
mailing list