]> git.sesse.net Git - vlc/blobdiff - modules/video_output/msw/wingdi.c
Win32: get rid of vlc_thread_ready()
[vlc] / modules / video_output / msw / wingdi.c
index 874ed302e64b498ea700ae953649111dd41f9881..190fd90293a6132e9b37eb45d6e555412c675057 100644 (file)
@@ -117,35 +117,27 @@ static void SetPalette( vout_thread_t *, uint16_t *, uint16_t *, uint16_t * );
 
 static void InitBuffers        ( vout_thread_t * );
 
-#ifdef MODULE_NAME_IS_wingapi
-#   define GXOpenDisplay p_vout->p_sys->GXOpenDisplay
-#   define GXCloseDisplay p_vout->p_sys->GXCloseDisplay
-#   define GXBeginDraw p_vout->p_sys->GXBeginDraw
-#   define GXEndDraw p_vout->p_sys->GXEndDraw
-#   define GXGetDisplayProperties p_vout->p_sys->GXGetDisplayProperties
-#   define GXSuspend p_vout->p_sys->GXSuspend
-#   define GXResume p_vout->p_sys->GXResume
-#endif
+
 
 #define DX_POSITION_CHANGE 0x1000
 
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
-vlc_module_begin();
-    set_category( CAT_VIDEO );
-    set_subcategory( SUBCAT_VIDEO_VOUT );
+vlc_module_begin ()
+    set_category( CAT_VIDEO )
+    set_subcategory( SUBCAT_VIDEO_VOUT )
 #ifdef MODULE_NAME_IS_wingapi
-    set_shortname( "Windows GAPI" );
-    set_description( N_("Windows GAPI video output") );
-    set_capability( "video output", 20 );
+    set_shortname( "Windows GAPI" )
+    set_description( N_("Windows GAPI video output") )
+    set_capability( "video output", 20 )
 #else
-    set_shortname( "Windows GDI" );
-    set_description( N_("Windows GDI video output") );
-    set_capability( "video output", 10 );
+    set_shortname( "Windows GDI" )
+    set_description( N_("Windows GDI video output") )
+    set_capability( "video output", 10 )
 #endif
-    set_callbacks( OpenVideo, CloseVideo );
-vlc_module_end();
+    set_callbacks( OpenVideo, CloseVideo )
+vlc_module_end ()
 
 /*****************************************************************************
  * OpenVideo: activate GDI video thread output method
@@ -250,14 +242,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;
-    if( vlc_thread_create( p_vout->p_sys->p_event, "VLC Vout Events Thread",
-                           EventThread, 0, 1 ) )
+    p_vout->p_sys->p_event->ready = CreateEvent( NULL, TRUE, FALSE, NULL );
+    if( vlc_thread_create( p_vout->p_sys->p_event, "Vout Events Thread",
+                           EventThread, 0, false ) )
     {
         msg_Err( p_vout, "cannot create Vout EventThread" );
+        CloseHandle( p_vout->p_sys->p_event->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->ready, INFINITE )
+    CloseHandle( p_vout->p_sys->p_event->ready );
 
     if( p_vout->p_sys->p_event->b_error )
     {
@@ -315,8 +311,10 @@ static void CloseVideo ( vlc_object_t *p_this )
 
     if( p_vout->b_fullscreen )
     {
-        Win32ToggleFullscreen( p_vout );
         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 )