[MPlayer-cvslog] r29617 - in trunk/libvo: vo_corevideo.h vo_corevideo.m
reimar
subversion at mplayerhq.hu
Tue Sep 1 23:16:59 CEST 2009
Author: reimar
Date: Tue Sep 1 23:16:58 2009
New Revision: 29617
Log:
Make glContext a local variable, it is not needed outside the function
where it is allocated, reference counting takes care of freeing it.
Modified:
trunk/libvo/vo_corevideo.h
trunk/libvo/vo_corevideo.m
Modified: trunk/libvo/vo_corevideo.h
==============================================================================
--- trunk/libvo/vo_corevideo.h Tue Sep 1 23:12:33 2009 (r29616)
+++ trunk/libvo/vo_corevideo.h Tue Sep 1 23:16:58 2009 (r29617)
@@ -40,7 +40,6 @@
{
//Cocoa
NSWindow *window;
- NSOpenGLContext *glContext;
NSEvent *event;
//CoreVideo
Modified: trunk/libvo/vo_corevideo.m
==============================================================================
--- trunk/libvo/vo_corevideo.m Tue Sep 1 23:12:33 2009 (r29616)
+++ trunk/libvo/vo_corevideo.m Tue Sep 1 23:16:58 2009 (r29617)
@@ -436,6 +436,7 @@ static int control(uint32_t request, voi
@implementation MPlayerOpenGLView
- (void) preinit
{
+ NSOpenGLContext *glContext;
GLint swapInterval = 1;
CVReturn error;
@@ -464,6 +465,7 @@ static int control(uint32_t request, voi
[glContext setValues:&swapInterval forParameter:NSOpenGLCPSwapInterval];
[glContext setView:self];
[glContext makeCurrentContext];
+ [glContext release];
error = CVOpenGLTextureCacheCreate(NULL, 0, [glContext CGLContextObj], [[self pixelFormat] CGLPixelFormatObj], 0, &textureCache);
if(error != kCVReturnSuccess)
@@ -486,8 +488,6 @@ static int control(uint32_t request, voi
CVOpenGLTextureCacheRelease(textureCache);
textureCache = NULL;
[self setOpenGLContext:nil];
- [glContext release];
- glContext = NULL;
[super dealloc];
}
More information about the MPlayer-cvslog
mailing list