[MPlayer-dev-eng] [PATCH] fix video playback clipping on OS X 10.7 (corevideo output)

Ian Levesque ian at ianlevesque.org
Wed Aug 10 02:30:57 CEST 2011


On OS X lion playing multiple videos with different resolutions using the corevideo output (the default) results in the video being clipped on the second and subsequent videos.  This is due to the output window from the previous video being present for a fraction of second after the new output window appears, and then the opengl viewport being incorrectly resized because of it.  My fix just explicitly releases the window and view instead of relying on autorelease to do it, which results in the window being closed before the new one is created consistently.

Index: libvo/vo_corevideo.m
===================================================================
--- libvo/vo_corevideo.m	(revision 33961)
+++ libvo/vo_corevideo.m	(working copy)
@@ -338,6 +338,8 @@
     if(mpGLView)
     {
         NSAutoreleasePool *finalPool;
+        [mpGLView.window close];
+        [mpGLView release];
         mpGLView = nil;
         [autoreleasepool release];
         finalPool = [[NSAutoreleasePool alloc] init];
@@ -399,7 +401,6 @@
 		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
@@ -454,7 +455,6 @@
 								styleMask:NSTitledWindowMask|NSTexturedBackgroundWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask
 								backing:NSBackingStoreBuffered defer:NO];
 
-	[window autorelease];
 	[window setDelegate:mpGLView];
 	[window setContentView:mpGLView];
 	[window setInitialFirstResponder:mpGLView];



More information about the MPlayer-dev-eng mailing list