p_vlc->p_libvlc->b_daemon = VLC_TRUE;
+ /* lets check if we need to write the pidfile */
+ char * psz_pidfile = config_GetPsz( p_vlc, "pidfile" );
+
+ msg_Dbg( p_vlc, "psz_pidfile is %s", psz_pidfile );
+
+ if( psz_pidfile != NULL )
+ {
+ FILE *pidfile;
+ pid_t i_pid = getpid ();
+
+ msg_Dbg( p_vlc, "our PID is %d, writing it to %s", i_pid, psz_pidfile );
+
+ pidfile = utf8_fopen( psz_pidfile,"w" );
+ if( pidfile != NULL )
+ {
+ utf8_fprintf( pidfile, "%d", (int)i_pid );
+ fclose( pidfile );
+ }
+ else
+ {
+ msg_Err( p_vlc, "Cannot open pid file for writing: %s, error: %s",
+ psz_pidfile, strerror(errno) );
+ }
+ }
+
+ free( psz_pidfile );
+
#else
pid_t i_pid;
}
libvlc.b_stats = config_GetInt( p_vlc, "stats" );
- libvlc.p_stats = NULL;
+ libvlc.i_timers = 0;
+ libvlc.pp_timers = NULL;
+ vlc_mutex_init( p_vlc, &libvlc.timer_lock );
/*
* Initialize hotkey handling
vout_thread_t * p_vout;
aout_instance_t * p_aout;
announce_handler_t * p_announce;
- stats_handler_t * p_stats;
vlc_t *p_vlc = vlc_current_object( i_object );
/* Check that the handle is valid */
aout_Delete( p_aout );
}
- while( ( p_stats = vlc_object_find( p_vlc, VLC_OBJECT_STATS, FIND_CHILD) ))
- {
- stats_TimersDumpAll( p_vlc );
- stats_HandlerDestroy( p_stats );
- vlc_object_detach( (vlc_object_t*) p_stats );
- vlc_object_release( (vlc_object_t *)p_stats );
- // TODO: Delete it
- }
+ stats_TimersDumpAll( p_vlc );
+ stats_TimersClean( p_vlc );
/*
* Free announce handler(s?)