]> git.sesse.net Git - vlc/blobdiff - modules/control/ntservice.c
Replace vlc_bool_t by bool, VLC_TRUE by true and VLC_FALSE by false.
[vlc] / modules / control / ntservice.c
index aeba86e729124997b321432e5d0dcdad47e129eb..952d06b834739758c2cd05b2b37f6467c8f69567 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
-#include <vlc/intf.h>
+#include <vlc_interface.h>
 
 #define VLCSERVICENAME "VLC media player"
 
@@ -63,15 +66,15 @@ vlc_module_begin();
     set_category( CAT_INTERFACE );
     set_subcategory( SUBCAT_INTERFACE_CONTROL );
     add_bool( "ntservice-install", 0, NULL,
-              INSTALL_TEXT, INSTALL_LONGTEXT, VLC_TRUE );
+              INSTALL_TEXT, INSTALL_LONGTEXT, true );
     add_bool( "ntservice-uninstall", 0, NULL,
-              UNINSTALL_TEXT, UNINSTALL_LONGTEXT, VLC_TRUE );
+              UNINSTALL_TEXT, UNINSTALL_LONGTEXT, true );
     add_string ( "ntservice-name", VLCSERVICENAME, NULL,
-                 NAME_TEXT, NAME_LONGTEXT, VLC_TRUE );
+                 NAME_TEXT, NAME_LONGTEXT, true );
     add_string ( "ntservice-options", NULL, NULL,
-                 OPTIONS_TEXT, OPTIONS_LONGTEXT, VLC_TRUE );
+                 OPTIONS_TEXT, OPTIONS_LONGTEXT, true );
     add_string ( "ntservice-extraintf", NULL, NULL,
-                 EXTRAINTF_TEXT, EXTRAINTF_LONGTEXT, VLC_TRUE );
+                 EXTRAINTF_TEXT, EXTRAINTF_LONGTEXT, true );
 
     set_capability( "interface", 0 );
     set_callbacks( Activate, Close );
@@ -164,7 +167,7 @@ static void Run( intf_thread_t *p_intf )
     }
 
     /* Make sure we exit (In case other interfaces have been spawned) */
-    p_intf->p_vlc->b_die = VLC_TRUE;
+    vlc_object_kill( p_intf->p_libvlc );
 }
 
 /*****************************************************************************
@@ -193,7 +196,7 @@ static int NTServiceInstall( intf_thread_t *p_intf )
         strcat( psz_path, " --ntservice-extraintf " );
         strcat( psz_path, psz_extra );
     }
-    if( psz_extra ) free( psz_extra );
+    free( psz_extra );
 
     psz_extra = config_GetPsz( p_intf, "ntservice-options" );
     if( psz_extra && *psz_extra )
@@ -201,7 +204,7 @@ static int NTServiceInstall( intf_thread_t *p_intf )
         strcat( psz_path, " " );
         strcat( psz_path, psz_extra );
     }
-    if( psz_extra ) free( psz_extra );
+    free( psz_extra );
 
     SC_HANDLE service =
         CreateService( handle, p_sys->psz_service, p_sys->psz_service,
@@ -325,7 +328,6 @@ static void WINAPI ServiceDispatch( DWORD numArgs, char **args )
             }
 
             /* Try to run the interface */
-            p_new_intf->b_block = VLC_FALSE;
             if( intf_RunThread( p_new_intf ) )
             {
                 vlc_object_detach( p_new_intf );
@@ -336,10 +338,7 @@ static void WINAPI ServiceDispatch( DWORD numArgs, char **args )
             free( psz_temp );
         }
     }
-    if( psz_modules )
-    {
-        free( psz_modules );
-    }
+    free( psz_modules );
 
     /* Initialization complete - report running status */
     p_sys->status.dwCurrentState = SERVICE_RUNNING;