[MPlayer-cvslog] r35179 - trunk/libvo/vo_corevideo.m

reimar subversion at mplayerhq.hu
Thu Sep 13 21:15:37 CEST 2012


Author: reimar
Date: Thu Sep 13 21:15:37 2012
New Revision: 35179

Log:
Move some code around in preparation for following patch.

Modified:
   trunk/libvo/vo_corevideo.m

Modified: trunk/libvo/vo_corevideo.m
==============================================================================
--- trunk/libvo/vo_corevideo.m	Thu Sep 13 21:11:55 2012	(r35178)
+++ trunk/libvo/vo_corevideo.m	Thu Sep 13 21:15:37 2012	(r35179)
@@ -405,27 +405,11 @@ static int preinit(const char *arg)
 
 	if(!shared_buffer)
 	{
-		NSApplicationLoad();
-		NSApp = [NSApplication sharedApplication];
-		isLeopardOrLater = floor(NSAppKitVersionNumber) > 824;
-
-		osx_foreground_hack();
-
 		if(!mpGLView)
 		{
 			mpGLView = [[MPlayerOpenGLView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) pixelFormat:[MPlayerOpenGLView defaultPixelFormat]];
 			[mpGLView autorelease];
 		}
-		// Install an event handler so the Quit menu entry works
-		// The proper way using NSApp setDelegate: and
-		// applicationShouldTerminate: does not work,
-		// probably NSApplication never installs its handler.
-		[[NSAppleEventManager sharedAppleEventManager]
-			setEventHandler:mpGLView
-			andSelector:@selector(handleQuitEvent:withReplyEvent:)
-			forEventClass:kCoreEventClass
-			andEventID:kAEQuitApplication];
-
 		[mpGLView display];
 		[mpGLView preinit];
 	}
@@ -463,6 +447,22 @@ static int control(uint32_t request, voi
 	GLint swapInterval = 1;
 	CVReturn error;
 
+	NSApplicationLoad();
+	NSApp = [NSApplication sharedApplication];
+	isLeopardOrLater = floor(NSAppKitVersionNumber) > 824;
+
+	osx_foreground_hack();
+
+	// Install an event handler so the Quit menu entry works
+	// The proper way using NSApp setDelegate: and
+	// applicationShouldTerminate: does not work,
+	// probably NSApplication never installs its handler.
+	[[NSAppleEventManager sharedAppleEventManager]
+		setEventHandler:self
+		andSelector:@selector(handleQuitEvent:withReplyEvent:)
+		forEventClass:kCoreEventClass
+		andEventID:kAEQuitApplication];
+
 	//init menu
 	[self initMenu];
 


More information about the MPlayer-cvslog mailing list