[MPlayer-users] -vo macosx. Bad Memory

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sat Jan 20 18:42:20 CET 2007


Hello,
On Sat, Jan 20, 2007 at 03:28:26PM +0000, thyme pancakes wrote:
> Sorry, forgot to attach the file.

This your changes as a patch. No idea if it is any good, I only made a
patch out of it so others can have a better look.

Greetings,
Reimar Döffinger
-------------- next part --------------
--- vo_macosx.m	2006-12-10 15:23:30.000000000 +0100
+++ vo_macosx.m	2007-01-20 18:37:23.000000000 +0100
@@ -251,7 +251,7 @@
     SetSystemUIMode( kUIModeNormal, 0);
     CGDisplayShowCursor(kCGDirectMainDisplay);
     
-    if(mpGLView)
+	if(mplayerosxProxy != nil)/*If we are not invoking mplayer from the command line*/
     {
         [autoreleasepool release];
     }
@@ -330,7 +331,7 @@
 		case VOCTRL_QUERY_FORMAT: return query_format(*((uint32_t*)data));
 		case VOCTRL_ONTOP: vo_ontop = (!(vo_ontop)); [mpGLView ontop]; return VO_TRUE;
 		case VOCTRL_ROOTWIN: vo_rootwin = (!(vo_rootwin)); [mpGLView rootwin]; return VO_TRUE;
-		case VOCTRL_FULLSCREEN: vo_fs = (!(vo_fs)); [mpGLView fullscreen: NO]; return VO_TRUE;
+		case VOCTRL_FULLSCREEN: vo_fs = (!(vo_fs)); [mpGLView fullscreen: YES]; return VO_TRUE;
 		case VOCTRL_GET_PANSCAN: return VO_TRUE;
 		case VOCTRL_SET_PANSCAN: [mpGLView panscan]; return VO_TRUE;
 	}
@@ -416,7 +417,7 @@
 */
 - (void)initMenu
 {
-	NSMenu *menu, *aspectMenu;
+	NSMenu *menu;
 	NSMenuItem *menuItem;
 	
 	[NSApp setMainMenu:[[NSMenu alloc] init]];
@@ -433,6 +434,7 @@
 	kFullScreenCmd = menuItem;
 	menuItem = (NSMenuItem *)[NSMenuItem separatorItem]; [menu addItem:menuItem];
 	
+		NSMenu	*aspectMenu;
 		aspectMenu = [[NSMenu alloc] initWithTitle:@"Aspect Ratio"];
 		menuItem = [[NSMenuItem alloc] initWithTitle:@"Keep" action:@selector(menuAction:) keyEquivalent:@""]; [aspectMenu addItem:menuItem];
 		if(vo_keepaspect) [menuItem setState:NSOnState];
@@ -492,7 +494,7 @@
 	if(sender == kHalfScreenCmd)
 	{
 		if(isFullscreen) {
-			vo_fs = (!(vo_fs)); [self fullscreen:NO];
+			vo_fs = (!(vo_fs)); [self fullscreen:YES];
 		}
 		
 		winSizeMult = 0.5;
@@ -504,7 +506,7 @@
 	if(sender == kNormalScreenCmd)
 	{
 		if(isFullscreen) {
-			vo_fs = (!(vo_fs)); [self fullscreen:NO];
+			vo_fs = (!(vo_fs)); [self fullscreen:YES];
 		}
 		
 		winSizeMult = 1;
@@ -516,7 +518,7 @@
 	if(sender == kDoubleScreenCmd)
 	{
 		if(isFullscreen) {
-			vo_fs = (!(vo_fs)); [self fullscreen:NO];
+			vo_fs = (!(vo_fs)); [self fullscreen:YES];
 		}
 		
 		winSizeMult = 2;
@@ -528,7 +530,7 @@
 	if(sender == kFullScreenCmd)
 	{
 		vo_fs = (!(vo_fs));
-		[self fullscreen:NO];
+		[self fullscreen:YES];
 	}
 
 	if(sender == kKeepAspectCmd)
@@ -668,9 +670,6 @@
 */ 
 - (void) render
 {
-	int curTime;
-	static int lastTime;
-
 	glClear(GL_COLOR_BUFFER_BIT);	
 	
 	glEnable(CVOpenGLTextureGetTarget(texture));
@@ -726,8 +725,8 @@
 	
 	//update activity every 30 seconds to prevent
 	//screensaver from starting up.
-	curTime  = TickCount()/60;
-	lastTime = 0;
+	int curTime = TickCount()/60;
+	static int lastTime = 0;
 		
 	if( ((curTime - lastTime) >= 30) || (lastTime == 0) )
 	{
@@ -1001,7 +1000,6 @@
 
 - (void)windowWillClose:(NSNotification *)aNotification
 {
-    mpGLView = NULL;
 	mplayer_put_key(KEY_ESC);
 }
 @end


More information about the MPlayer-users mailing list