Commit e4345c82 authored by Sam Hocevar's avatar Sam Hocevar

* src/misc/modules.c: Allow for premature Ctrl-C escapes even while VLC

    is loading its plugins.
parent 0863ba24
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libvlc.c: main libvlc source * libvlc.c: main libvlc source
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2002 VideoLAN * Copyright (C) 1998-2002 VideoLAN
* $Id: libvlc.c,v 1.103 2003/11/25 00:56:34 fenrir Exp $ * $Id: libvlc.c,v 1.104 2003/11/25 12:35:15 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -285,8 +285,8 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] ) ...@@ -285,8 +285,8 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
vlc_mutex_lock( lockval.p_address ); vlc_mutex_lock( lockval.p_address );
if( libvlc.p_module_bank == NULL ) if( libvlc.p_module_bank == NULL )
{ {
module_InitBank( p_libvlc ); module_InitBank( p_vlc );
module_LoadMain( p_libvlc ); module_LoadMain( p_vlc );
} }
vlc_mutex_unlock( lockval.p_address ); vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc, "libvlc" ); var_Destroy( p_libvlc, "libvlc" );
...@@ -376,8 +376,8 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] ) ...@@ -376,8 +376,8 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
#endif #endif
module_EndBank( p_vlc ); module_EndBank( p_vlc );
module_InitBank( p_libvlc ); module_InitBank( p_vlc );
module_LoadMain( p_libvlc ); module_LoadMain( p_vlc );
config_LoadCmdLine( p_vlc, &i_argc, ppsz_argv, VLC_TRUE ); config_LoadCmdLine( p_vlc, &i_argc, ppsz_argv, VLC_TRUE );
} }
if( psz_language ) free( psz_language ); if( psz_language ) free( psz_language );
...@@ -389,8 +389,13 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] ) ...@@ -389,8 +389,13 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
* list of configuration options exported by each module and loads their * list of configuration options exported by each module and loads their
* default values. * default values.
*/ */
module_LoadBuiltins( p_libvlc ); module_LoadBuiltins( p_vlc );
module_LoadPlugins( p_libvlc ); module_LoadPlugins( p_vlc );
if( p_vlc->b_die )
{
b_exit = VLC_TRUE;
}
msg_Dbg( p_vlc, "module bank initialized, found %i modules", msg_Dbg( p_vlc, "module bank initialized, found %i modules",
libvlc.p_module_bank->i_children ); libvlc.p_module_bank->i_children );
...@@ -764,7 +769,7 @@ int VLC_Destroy( int i_object ) ...@@ -764,7 +769,7 @@ int VLC_Destroy( int i_object )
* VLC_Die: ask vlc to die. * VLC_Die: ask vlc to die.
***************************************************************************** *****************************************************************************
* This function sets p_vlc->b_die to VLC_TRUE, but does not do any other * This function sets p_vlc->b_die to VLC_TRUE, but does not do any other
* task. It is your duty to call vlc_end and VLC_Destroy afterwards. * task. It is your duty to call VLC_End and VLC_Destroy afterwards.
*****************************************************************************/ *****************************************************************************/
int VLC_Die( int i_object ) int VLC_Die( int i_object )
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* modules.c : Builtin and plugin modules management functions * modules.c : Builtin and plugin modules management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: modules.c,v 1.140 2003/11/19 13:10:48 gbazin Exp $ * $Id: modules.c,v 1.141 2003/11/25 12:35:15 sam Exp $
* *
* Authors: Sam Hocevar <sam@zoy.org> * Authors: Sam Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com> * Ethan C. Baldridge <BaldridgeE@cadmus.com>
...@@ -678,7 +678,7 @@ static void AllocatePluginDir( vlc_object_t *p_this, const MYCHAR *psz_dir, ...@@ -678,7 +678,7 @@ static void AllocatePluginDir( vlc_object_t *p_this, const MYCHAR *psz_dir,
struct dirent * file; struct dirent * file;
#endif #endif
if( i_maxdepth < 0 ) if( p_this->p_vlc->b_die || i_maxdepth < 0 )
{ {
return; return;
} }
...@@ -738,7 +738,7 @@ static void AllocatePluginDir( vlc_object_t *p_this, const MYCHAR *psz_dir, ...@@ -738,7 +738,7 @@ static void AllocatePluginDir( vlc_object_t *p_this, const MYCHAR *psz_dir,
AllocatePluginFile( p_this, psz_path ); AllocatePluginFile( p_this, psz_path );
} }
} }
while( FindNextFile( handle, &finddata ) ); while( !p_this->p_vlc->b_die && FindNextFile( handle, &finddata ) );
/* Close the directory */ /* Close the directory */
FindClose( handle ); FindClose( handle );
...@@ -753,7 +753,7 @@ static void AllocatePluginDir( vlc_object_t *p_this, const MYCHAR *psz_dir, ...@@ -753,7 +753,7 @@ static void AllocatePluginDir( vlc_object_t *p_this, const MYCHAR *psz_dir,
i_dirlen = strlen( psz_dir ); i_dirlen = strlen( psz_dir );
/* Parse the directory and try to load all files it contains. */ /* Parse the directory and try to load all files it contains. */
while( (file = readdir( dir )) ) while( !p_this->p_vlc->b_die && (file = readdir( dir )) )
{ {
struct stat statbuf; struct stat statbuf;
unsigned int i_len; unsigned int i_len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment