From 32b211e47175cd50964950fc8beedc3c5f2deb02 Mon Sep 17 00:00:00 2001 From: Gildas Bazin Date: Thu, 22 Jul 2004 22:14:42 +0000 Subject: [PATCH] * modules/video_output/x11/glx.c, modules/video_output/opengl.c: some fixes. --- modules/video_output/opengl.c | 23 ++++++++++++++++++++--- modules/video_output/x11/glx.c | 5 +++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c index 0203ad0548..35770e78bd 100644 --- a/modules/video_output/opengl.c +++ b/modules/video_output/opengl.c @@ -53,10 +53,11 @@ static int CreateVout ( vlc_object_t * ); static void DestroyVout ( vlc_object_t * ); static int Init ( vout_thread_t * ); static void End ( vout_thread_t * ); -static void Render ( vout_thread_t *p_vout, picture_t *p_pic ); +static int Manage ( vout_thread_t * ); +static void Render ( vout_thread_t *, picture_t * ); static void DisplayVideo ( vout_thread_t *, picture_t * ); -static inline int GetAlignedSize( int i_size ); +static inline int GetAlignedSize( int ); /***************************************************************************** * Module descriptor @@ -85,7 +86,6 @@ struct vout_sys_t GLuint texture; int i_effect; //XXX - }; /***************************************************************************** @@ -126,6 +126,10 @@ static int CreateVout( vlc_object_t *p_this ) p_sys->p_vout->i_window_width = p_vout->i_window_width; p_sys->p_vout->i_window_height = p_vout->i_window_height; p_sys->p_vout->b_fullscreen = p_vout->b_fullscreen; + p_sys->p_vout->render.i_width = p_vout->render.i_width; + p_sys->p_vout->render.i_height = p_vout->render.i_height; + p_sys->p_vout->render.i_aspect = p_vout->render.i_aspect; + p_sys->p_vout->i_window_height = p_vout->i_window_height; p_sys->p_vout->p_module = module_Need( p_sys->p_vout, "opengl provider", NULL, 0 ); @@ -139,6 +143,7 @@ static int CreateVout( vlc_object_t *p_this ) p_vout->pf_init = Init; p_vout->pf_end = End; + p_vout->pf_manage = Manage; p_vout->pf_render = Render; p_vout->pf_display = DisplayVideo; @@ -260,6 +265,18 @@ static void DestroyVout( vlc_object_t *p_this ) free( p_sys ); } +/***************************************************************************** + * Manage: handle Sys events + ***************************************************************************** + * This function should be called regularly by video output thread. It returns + * a non null value if an error occured. + *****************************************************************************/ +static int Manage( vout_thread_t *p_vout ) +{ + vout_sys_t *p_sys = p_vout->p_sys; + return p_sys->p_vout->pf_manage( p_sys->p_vout ); +} + /***************************************************************************** * Render: render previously calculated output *****************************************************************************/ diff --git a/modules/video_output/x11/glx.c b/modules/video_output/x11/glx.c index d89222cf31..1c4fde69f9 100644 --- a/modules/video_output/x11/glx.c +++ b/modules/video_output/x11/glx.c @@ -171,6 +171,7 @@ static int CheckGLX( vlc_object_t *p_this, vlc_bool_t *b_glx13 ) if( !p_display ) { msg_Err( p_this, "Cannot open display" ); + XCloseDisplay( p_display ); return VLC_EGENERIC; } @@ -178,11 +179,13 @@ static int CheckGLX( vlc_object_t *p_this, vlc_bool_t *b_glx13 ) if( !XQueryExtension( p_display, "GLX", &i_opcode, &i_evt, &i_err ) ) { msg_Err( p_this, "GLX extension not supported" ); + XCloseDisplay( p_display ); return VLC_EGENERIC; } if( !glXQueryExtension( p_display, &i_err, &i_evt ) ) { msg_Err( p_this, "glXQueryExtension failed" ); + XCloseDisplay( p_display ); return VLC_EGENERIC; } @@ -190,6 +193,7 @@ static int CheckGLX( vlc_object_t *p_this, vlc_bool_t *b_glx13 ) if (!glXQueryVersion( p_display, &i_maj, &i_min ) ) { msg_Err( p_this, "glXQueryVersion failed" ); + XCloseDisplay( p_display ); return VLC_EGENERIC; } if( i_maj <= 0 || ((i_maj == 1) && (i_min < 3)) ) @@ -203,6 +207,7 @@ static int CheckGLX( vlc_object_t *p_this, vlc_bool_t *b_glx13 ) msg_Dbg( p_this, "Using GLX 1.3 API" ); } + XCloseDisplay( p_display ); return VLC_SUCCESS; } -- 2.39.2