vlc_value_t val;
#if defined( ENABLE_NLS ) \
&& ( defined( HAVE_GETTEXT ) || defined( HAVE_INCLUDED_GETTEXT ) )
+# if defined (WIN32) || defined (__APPLE__)
char * psz_language;
+#endif
#endif
if( !p_vlc )
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
/*
* Initialize playlist and get commandline files
*/
- p_playlist = playlist_Create( p_vlc );
+ p_playlist = playlist_ThreadCreate( p_vlc );
if( !p_playlist )
{
msg_Err( p_vlc, "playlist initialization failed" );
#ifdef HAVE_X11_XLIB_H
if( config_GetInt( p_vlc, "disable-screensaver" ) == 1 )
{
- VLC_AddIntf( 0, "screensaver", VLC_FALSE, VLC_FALSE );
+ VLC_AddIntf( 0, "screensaver,none", VLC_FALSE, VLC_FALSE );
}
#endif
if( config_GetInt( p_vlc, "file-logging" ) == 1 )
{
- VLC_AddIntf( 0, "logger", VLC_FALSE, VLC_FALSE );
+ VLC_AddIntf( 0, "logger,none", VLC_FALSE, VLC_FALSE );
}
#ifdef HAVE_SYSLOG_H
if( config_GetInt( p_vlc, "syslog" ) == 1 )
{
char *psz_logmode = "logmode=syslog";
- AddIntfInternal( 0, "logger", VLC_FALSE, VLC_FALSE, 1, &psz_logmode );
+ AddIntfInternal( 0, "logger,none", VLC_FALSE, VLC_FALSE, 1, &psz_logmode );
}
#endif
if( config_GetInt( p_vlc, "show-intf" ) == 1 )
{
- VLC_AddIntf( 0, "showintf", VLC_FALSE, VLC_FALSE );
+ VLC_AddIntf( 0, "showintf,none", VLC_FALSE, VLC_FALSE );
}
if( config_GetInt( p_vlc, "network-synchronisation") == 1 )
{
- VLC_AddIntf( 0, "netsync", VLC_FALSE, VLC_FALSE );
+ VLC_AddIntf( 0, "netsync,none", VLC_FALSE, VLC_FALSE );
}
/*
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 */
{
vlc_object_detach( p_playlist );
vlc_object_release( p_playlist );
- playlist_Destroy( p_playlist );
+ playlist_ThreadDestroy( p_playlist );
}
/*
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?)
if( p_playlist == NULL )
{
msg_Dbg( p_vlc, "no playlist present, creating one" );
- p_playlist = playlist_Create( p_vlc );
+ p_playlist = playlist_ThreadCreate( p_vlc );
if( p_playlist == NULL )
{
vlc_object_yield( p_playlist );
}
- i_err = playlist_AddExt( p_playlist, psz_target, psz_target,
+ i_err = playlist_PlaylistAddExt( p_playlist, psz_target, psz_target,
i_mode, i_pos, -1, ppsz_options, i_options);
vlc_object_release( p_playlist );
}
else
{
- msg_Dbg(p_vlc, "polling playlist_IsPlaying");
b_playing = playlist_IsPlaying( p_playlist );
}
vlc_object_release( p_playlist );
*/
int VLC_PlaylistIndex( int i_object )
{
- int i_index;
- playlist_t * p_playlist;
- vlc_t *p_vlc = vlc_current_object( i_object );
-
- /* Check that the handle is valid */
- if( !p_vlc )
- {
- return VLC_ENOOBJ;
- }
-
- p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST, FIND_CHILD );
-
- if( !p_playlist )
- {
- if( i_object ) vlc_object_release( p_vlc );
- return VLC_ENOOBJ;
- }
-
- i_index = p_playlist->i_index;
- vlc_object_release( p_playlist );
-
- if( i_object ) vlc_object_release( p_vlc );
- return i_index;
+ printf( "This function is deprecated and should not be used anymore" );
+ return -1;
}
/**
*****************************************************************************/
int VLC_PlaylistClear( int i_object )
{
- int i_err;
playlist_t * p_playlist;
vlc_t *p_vlc = vlc_current_object( i_object );
return VLC_ENOOBJ;
}
- i_err = playlist_Clear( p_playlist );
+ playlist_Clear( p_playlist );
vlc_object_release( p_playlist );
if( i_object ) vlc_object_release( p_vlc );
- return i_err;
+ return VLC_SUCCESS;
}
/**