X-Git-Url: https://git.videolan.org/gitweb.cgi/vlc.git/?p=vlc.git;p=vlc.git;a=blobdiff_plain;f=modules%2Fvideo_output%2Fopengllayer.m;h=52c49853b73ce01389c2ced388ab903e0f76b8b0;hp=11ed466f829d84bc2a567243d5a59ac34e12634a;hb=250c38916b1c085a7b271da0f383862610ec2b7b;hpb=d37c8970e7c2573051a291eec055c4b91767d417 diff --git a/modules/video_output/opengllayer.m b/modules/video_output/opengllayer.m index 11ed466f82..52c49853b7 100644 --- a/modules/video_output/opengllayer.m +++ b/modules/video_output/opengllayer.m @@ -313,6 +313,7 @@ static void DisplayVideo( vout_thread_t *p_vout, picture_t *p_pic ) } p_sys->b_frame_available = 1; + [p_sys->o_layer setNeedsDisplay]; } /***************************************************************************** @@ -366,11 +367,12 @@ static int InitTextures( vout_thread_t *p_vout ) our buffer */ glEnable( GL_UNPACK_CLIENT_STORAGE_APPLE ); glPixelStorei( GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE ); -#endif /* Use AGP texturing */ glTexParameteri( VLCGL_TARGET, GL_TEXTURE_STORAGE_HINT_APPLE, GL_STORAGE_SHARED_APPLE ); +#endif + /* Call glTexImage2D only once, and use glTexSubImage2D later */ glTexImage2D( VLCGL_TARGET, 0, 3, p_sys->i_tex_width, p_sys->i_tex_height, 0, VLCGL_FORMAT, VLCGL_TYPE, @@ -407,7 +409,7 @@ static int InitTextures( vout_thread_t *p_vout ) VLCVoutLayer* me = [super layer]; if( me ) { - me.asynchronous = YES; + me.asynchronous = NO; [me setVout: _p_vout]; me.bounds = CGRectMake( 0.0, 0.0, (float)_p_vout->fmt_in.i_visible_width * _p_vout->fmt_in.i_sar_num, @@ -419,7 +421,9 @@ static int InitTextures( vout_thread_t *p_vout ) - (BOOL)canDrawInCGLContext:(CGLContextObj)glContext pixelFormat:(CGLPixelFormatObj)pixelFormat forLayerTime:(CFTimeInterval)timeInterval displayTime:(const CVTimeStamp *)timeStamp { /* Only draw the frame when if have a frame that was previously rendered */ - return p_vout->p_sys->b_frame_available; + BOOL ret = p_vout->p_sys->b_frame_available; + p_vout->p_sys->b_frame_available = VLC_FALSE; + return ret; } - (void)drawInCGLContext:(CGLContextObj)glContext pixelFormat:(CGLPixelFormatObj)pixelFormat forLayerTime:(CFTimeInterval)timeInterval displayTime:(const CVTimeStamp *)timeStamp