]> git.sesse.net Git - vlc/blobdiff - modules/video_output/msw/glwin32.c
Remove unused parameter
[vlc] / modules / video_output / msw / glwin32.c
index 6cd20ceb0f5fc943342a56390a0b1b145ce99307..10f6bd8d834d06ce5925f44ccc8d39d533c14a74 100644 (file)
@@ -62,18 +62,18 @@ static void FirstSwap( vout_thread_t * );
 /*****************************************************************************
  * 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
@@ -134,14 +134,18 @@ static int OpenVideo( vlc_object_t *p_this )
     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 )
     {
@@ -220,7 +224,13 @@ static void CloseVideo( vlc_object_t *p_this )
 {
     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 )
     {
@@ -242,11 +252,8 @@ static void CloseVideo( vlc_object_t *p_this )
 
     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;
 }
 
 /*****************************************************************************
@@ -390,7 +397,7 @@ static int Manage( vout_thread_t *p_vout )
     }
 
     /* 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 */
     }