*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
char * psz_parser;
char * psz_control;
vlc_bool_t b_exit = VLC_FALSE;
+ int i_ret = VLC_EEXIT;
vlc_t * p_vlc = vlc_current_object( i_object );
module_t *p_help_module;
playlist_t *p_playlist;
{
Help( p_vlc, "help" );
b_exit = VLC_TRUE;
+ i_ret = VLC_EEXITSUCCESS;
}
/* Check for version option */
else if( config_GetInt( p_vlc, "version" ) )
{
Version();
b_exit = VLC_TRUE;
+ i_ret = VLC_EEXITSUCCESS;
}
/* Set the config file stuff */
/* This is the parent, exit right now */
msg_Dbg( p_vlc, "closing parent process" );
b_exit = VLC_TRUE;
+ i_ret = VLC_EEXITSUCCESS;
}
else
{
vlc_object_destroy( p_help_module );
module_EndBank( p_vlc );
if( i_object ) vlc_object_release( p_vlc );
- return VLC_EEXIT;
+ return i_ret;
}
/* Check for translation config option */
Help( p_vlc, p_tmp );
free( p_tmp );
b_exit = VLC_TRUE;
+ i_ret = VLC_EEXITSUCCESS;
}
/* Check for long help option */
else if( config_GetInt( p_vlc, "longhelp" ) )
{
Help( p_vlc, "longhelp" );
b_exit = VLC_TRUE;
+ i_ret = VLC_EEXITSUCCESS;
}
/* Check for module list option */
else if( config_GetInt( p_vlc, "list" ) )
{
ListModules( p_vlc );
b_exit = VLC_TRUE;
+ i_ret = VLC_EEXITSUCCESS;
}
/* Check for config file options */
vlc_object_destroy( p_help_module );
module_EndBank( p_vlc );
if( i_object ) vlc_object_release( p_vlc );
- return VLC_EEXIT;
+ return i_ret;
}
/*
p_vlc->pf_memset = memset;
}
+ libvlc.b_stats = config_GetInt( p_vlc, "stats" );
+
/*
* 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 */
}
/*
- * Free playlists
+ * Free playlist
*/
- msg_Dbg( p_vlc, "removing all playlists" );
+ msg_Dbg( p_vlc, "removing playlist handler" );
while( (p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST,
FIND_CHILD )) )
{
aout_Delete( p_aout );
}
+ while( ( p_stats = vlc_object_find( p_vlc, VLC_OBJECT_STATS, FIND_CHILD) ))
+ {
+ stats_HandlerDestroy( p_stats );
+ vlc_object_detach( (vlc_object_t*) p_stats );
+ vlc_object_release( (vlc_object_t *)p_stats );
+ // TODO: Delete it
+ }
+
/*
* Free announce handler(s?)
*/
- msg_Dbg( p_vlc, "removing announce handler" );
while( (p_announce = vlc_object_find( p_vlc, VLC_OBJECT_ANNOUNCE,
FIND_CHILD ) ) )
- {
+ {
+ msg_Dbg( p_vlc, "removing announce handler" );
vlc_object_detach( p_announce );
vlc_object_release( p_announce );
announce_HandlerDestroy( p_announce );
- }
+ }
if( i_object ) vlc_object_release( p_vlc );
return VLC_SUCCESS;
}
/*****************************************************************************
- * VLC_Play: play
+ * VLC_Play: play the playlist
*****************************************************************************/
int VLC_Play( int i_object )
{
{
playlist_t * p_playlist;
vlc_bool_t b_playing;
- vlc_value_t val;
vlc_t *p_vlc = vlc_current_object( i_object );
if( i_object ) vlc_object_release( p_vlc );
return VLC_ENOOBJ;
}
- if( !p_playlist->p_input )
+
+ if( p_playlist->p_input )
{
- if( i_object ) vlc_object_release( p_vlc );
- return VLC_ENOOBJ;
+ vlc_value_t val;
+ var_Get( p_playlist->p_input, "state", &val );
+ b_playing = ( val.i_int == PLAYING_S );
+ }
+ else
+ {
+ msg_Dbg(p_vlc, "polling playlist_IsPlaying");
+ b_playing = playlist_IsPlaying( p_playlist );
}
- var_Get( p_playlist->p_input, "state", &val );
- b_playing = ( val.i_int == PLAYING_S );
vlc_object_release( p_playlist );
if( i_object ) vlc_object_release( p_vlc );
#endif
if( !bindtextdomain( PACKAGE_NAME, psz_path ) )
{
- fprintf( stderr, "warning: no domain %s in directory %s\n",
+ fprintf( stderr, "warning: couldn't bind domain %s in directory %s\n",
PACKAGE_NAME, psz_path );
}
if( strcmp( VLC_Changeset(), "exported" ) )
fprintf( stdout, _("Based upon svn changeset [%s]\n"),
VLC_Changeset() );
- fprintf( stdout,
- _("This program comes with NO WARRANTY, to the extent permitted by "
- "law.\nYou may redistribute it under the terms of the GNU General "
- "Public License;\nsee the file named COPYING for details.\n"
- "Written by the VideoLAN team; see the AUTHORS file.\n") );
+ fprintf( stdout, LICENSE_MSG );
#ifdef WIN32 /* Pause the console because it's destroyed when we exit */
PauseConsole();
char **devices;
char *block_dev;
dbus_bool_t b_dvd;
+ DBusConnection *p_connection;
+ DBusError error;
+#ifdef HAVE_HAL_1
+ ctx = libhal_ctx_new();
+ if( !ctx ) return;
+ dbus_error_init( &error );
+ p_connection = dbus_bus_get ( DBUS_BUS_SYSTEM, &error );
+ if( dbus_error_is_set( &error ) )
+ {
+ dbus_error_free( &error );
+ return;
+ }
+ libhal_ctx_set_dbus_connection( ctx, p_connection );
+ if( libhal_ctx_init( ctx, &error ) )
+#else
if( ( ctx = hal_initialize( NULL, FALSE ) ) )
+#endif
{
+#ifdef HAVE_HAL_1
+ if( ( devices = libhal_get_all_devices( ctx, &i_devices, NULL ) ) )
+#else
if( ( devices = hal_get_all_devices( ctx, &i_devices ) ) )
+#endif
{
for( i = 0; i < i_devices; i++ )
{
+#ifdef HAVE_HAL_1
+ if( !libhal_device_property_exists( ctx, devices[i],
+ "storage.cdrom.dvd", NULL ) )
+#else
if( !hal_device_property_exists( ctx, devices[ i ],
"storage.cdrom.dvd" ) )
+#endif
{
continue;
}
-
+#ifdef HAVE_HAL_1
+ b_dvd = libhal_device_get_property_bool( ctx, devices[ i ],
+ "storage.cdrom.dvd", NULL );
+ block_dev = libhal_device_get_property_string( ctx,
+ devices[ i ], "block.device" , NULL );
+#else
b_dvd = hal_device_get_property_bool( ctx, devices[ i ],
"storage.cdrom.dvd" );
block_dev = hal_device_get_property_string( ctx, devices[ i ],
"block.device" );
-
+#endif
if( b_dvd )
{
config_PutPsz( p_vlc, "dvd", block_dev );
config_PutPsz( p_vlc, "vcd", block_dev );
config_PutPsz( p_vlc, "cd-audio", block_dev );
-
+#ifdef HAVE_HAL_1
+ libhal_free_string( block_dev );
+#else
hal_free_string( block_dev );
+#endif
}
+#ifdef HAVE_HAL_1
+ libhal_free_string_array( devices );
+#else
hal_free_string_array( devices );
+#endif
}
+#ifdef HAVE_HAL_1
+ libhal_ctx_shutdown( ctx, NULL );
+#else
hal_shutdown( ctx );
+#endif
+ }
+ else
+ {
+ msg_Warn( p_vlc, "Unable to get HAL device properties" );
}
#endif
}