/*****************************************************************************
* Module descriptor
*****************************************************************************/
-vlc_module_begin();
- set_category( CAT_VIDEO );
- set_subcategory( SUBCAT_VIDEO_VOUT );
- set_shortname( "OpenGL" );
- set_description( N_("OpenGL video output") );
- set_capability( "opengl provider", 100 );
- add_shortcut( "glwin32" );
- set_callbacks( OpenVideo, CloseVideo );
+vlc_module_begin ()
+ set_category( CAT_VIDEO )
+ set_subcategory( SUBCAT_VIDEO_VOUT )
+ set_shortname( "OpenGL" )
+ set_description( N_("OpenGL video output") )
+ set_capability( "opengl provider", 100 )
+ add_shortcut( "glwin32" )
+ set_callbacks( OpenVideo, CloseVideo )
/* FIXME: Hack to avoid unregistering our window class */
- linked_with_a_crap_library_which_uses_atexit( );
-vlc_module_end();
+ linked_with_a_crap_library_which_uses_atexit ()
+vlc_module_end ()
#if 0 /* FIXME */
/* check if we registered a window class because we need to
p_vout->p_sys->p_event =
vlc_object_create( p_vout, sizeof(event_thread_t) );
p_vout->p_sys->p_event->p_vout = p_vout;
+ p_vout->p_sys->p_event->window_ready = CreateEvent( NULL, TRUE, FALSE, NULL );
if( vlc_thread_create( p_vout->p_sys->p_event, "Vout Events Thread",
- EventThread, 0, 1 ) )
+ EventThread, 0 ) )
{
msg_Err( p_vout, "cannot create Vout EventThread" );
+ CloseHandle( p_vout->p_sys->p_event->window_ready );
vlc_object_release( p_vout->p_sys->p_event );
p_vout->p_sys->p_event = NULL;
goto error;
}
+ WaitForSingleObject( p_vout->p_sys->p_event->window_ready, INFINITE );
+ CloseHandle( p_vout->p_sys->p_event->window_ready );
if( p_vout->p_sys->p_event->b_error )
{
{
vout_thread_t * p_vout = (vout_thread_t *)p_this;
- msg_Dbg( p_vout, "closing video" );
+ if( p_vout->b_fullscreen )
+ {
+ msg_Dbg( p_vout, "Quitting fullscreen" );
+ Win32ToggleFullscreen( p_vout );
+ /* Force fullscreen in the core for the next video */
+ var_SetBool( p_vout, "fullscreen", true );
+ }
if( p_vout->p_sys->p_event )
{
vlc_mutex_destroy( &p_vout->p_sys->lock );
- if( p_vout->p_sys )
- {
- free( p_vout->p_sys );
- p_vout->p_sys = NULL;
- }
+ free( p_vout->p_sys );
+ p_vout->p_sys = NULL;
}
/*****************************************************************************
}
/* Check if the event thread is still running */
- if( p_vout->p_sys->p_event->b_die )
+ if( !vlc_object_alive (p_vout->p_sys->p_event) )
{
return VLC_EGENERIC; /* exit */
}