]> git.sesse.net Git - vlc/blobdiff - modules/video_output/msw/directx.c
Remove unused parameter
[vlc] / modules / video_output / msw / directx.c
index cd8ed738c6450cde3a6bd868830b5db81172ee6e..e3242794e711e99457812a2e57adf76efdf4f800 100644 (file)
@@ -160,10 +160,10 @@ static int WallpaperCallback( vlc_object_t *, char const *,
 static const char *const ppsz_dev[] = { "" };
 static const char *const ppsz_dev_text[] = { N_("Default") };
 
-vlc_module_begin();
-    set_shortname( "DirectX" );
-    set_category( CAT_VIDEO );
-    set_subcategory( SUBCAT_VIDEO_VOUT );
+vlc_module_begin ()
+    set_shortname( "DirectX" )
+    set_category( CAT_VIDEO )
+    set_subcategory( SUBCAT_VIDEO_VOUT )
     add_bool( "directx-hw-yuv", 1, NULL, HW_YUV_TEXT, HW_YUV_LONGTEXT,
               true );
     add_bool( "directx-use-sysmem", 0, NULL, SYSMEM_TEXT, SYSMEM_LONGTEXT,
@@ -174,19 +174,19 @@ vlc_module_begin();
     add_string( "directx-device", "", NULL, DEVICE_TEXT, DEVICE_LONGTEXT,
                 true );
         change_string_list( ppsz_dev, ppsz_dev_text, FindDevicesCallback );
-        change_action_add( FindDevicesCallback, N_("Refresh list") );
+        change_action_add( FindDevicesCallback, N_("Refresh list") )
 
     add_bool( "directx-wallpaper", 0, NULL, WALLPAPER_TEXT, WALLPAPER_LONGTEXT,
               true );
 
-    set_description( N_("DirectX video output") );
-    set_capability( "video output", 100 );
-    add_shortcut( "directx" );
-    set_callbacks( OpenVideo, CloseVideo );
+    set_description( N_("DirectX video output") )
+    set_capability( "video output", 100 )
+    add_shortcut( "directx" )
+    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
@@ -277,14 +277,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 )
     {
@@ -488,7 +492,13 @@ static void CloseVideo( vlc_object_t *p_this )
 {
     vout_thread_t * p_vout = (vout_thread_t *)p_this;
 
-    msg_Dbg( p_vout, "CloseVideo" );
+    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 )
     {
@@ -691,7 +701,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 */
     }
@@ -2123,17 +2133,15 @@ static int WallpaperCallback( vlc_object_t *p_this, char const *psz_cmd,
     if( (newval.b_bool && !p_vout->p_sys->b_wallpaper) ||
         (!newval.b_bool && p_vout->p_sys->b_wallpaper) )
     {
-        playlist_t *p_playlist;
+        playlist_t *p_playlist = pl_Hold( p_vout );
 
-        p_playlist = vlc_object_find( p_this,
-                                     VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
         if( p_playlist )
         {
             /* Modify playlist as well because the vout might have to be
              * restarted */
             var_Create( p_playlist, "directx-wallpaper", VLC_VAR_BOOL );
             var_Set( p_playlist, "directx-wallpaper", newval );
-            vlc_object_release( p_playlist );
+            pl_Release( p_vout );
         }
 
         p_vout->p_sys->i_changes |= DX_WALLPAPER_CHANGE;