# include <dirent.h>
#endif
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
# include <unistd.h>
#endif
-#if !defined(HAVE_DYNAMIC_PLUGINS)
- /* no support for plugins */
-#elif defined(HAVE_DL_DYLD)
-# if defined(HAVE_MACH_O_DYLD_H)
-# include <mach-o/dyld.h>
-# endif
-#elif defined(HAVE_DL_BEOS)
-# if defined(HAVE_IMAGE_H)
-# include <image.h>
-# endif
-#elif defined(HAVE_DL_WINDOWS)
-# include <windows.h>
-#elif defined(HAVE_DL_DLOPEN)
-# if defined(HAVE_DLFCN_H) /* Linux, BSD, Hurd */
-# include <dlfcn.h>
-# endif
-# if defined(HAVE_SYS_DL_H)
-# include <sys/dl.h>
-# endif
-#elif defined(HAVE_DL_SHL_LOAD)
-# if defined(HAVE_DL_H)
-# include <dl.h>
-# endif
-#endif
-
#include "config/configuration.h"
#include "vlc_charset.h"
#include "vlc_arrays.h"
-#include <vlc_cpu.h>
#include "modules/modules.h"
* options of main will be available in the module bank structure just
* as for every other module. */
AllocateBuiltinModule( p_this, vlc_entry__main );
+ vlc_rwlock_init (&config_lock);
+ config_SortConfig ();
}
else
p_module_bank->i_usage++;
assert (p_bank != NULL);
/* Save the configuration */
- if( !config_GetInt( p_this, "ignore-config" ) )
+ if( !var_InheritBool( p_this, "ignore-config" ) )
config_AutoSaveConfigFile( p_this );
/* If plugins were _not_ loaded, then the caller still has the bank lock
vlc_mutex_unlock( &module_lock );
return;
}
+
+ config_UnsortConfig ();
+ vlc_rwlock_destroy (&config_lock);
p_module_bank = NULL;
vlc_mutex_unlock( &module_lock );
#ifdef HAVE_DYNAMIC_PLUGINS
- if( p_bank->b_cache )
- CacheSave( p_this, p_bank );
while( p_bank->i_loaded_cache-- )
{
if( p_bank->pp_loaded_cache[p_bank->i_loaded_cache] )
if( p_bank->i_usage == 1 )
{
msg_Dbg( p_this, "checking plugin modules" );
- p_module_bank->b_cache = config_GetInt( p_this, "plugins-cache" ) > 0;
+ p_module_bank->b_cache = var_InheritBool( p_this, "plugins-cache" );
if( p_module_bank->b_cache || b_cache_delete )
CacheLoad( p_this, p_module_bank, b_cache_delete );
AllocateAllPlugins( p_this, p_module_bank );
+ if( p_module_bank->b_cache )
+ CacheSave( p_this, p_bank );
+ config_UnsortConfig ();
+ config_SortConfig ();
}
#endif
- p_module_bank->b_plugins = true;
vlc_mutex_unlock( &module_lock );
}
}
i_shortcuts++;
- psz_shortcuts = psz_last_shortcut = strdup( psz_name );
+ psz_parser = psz_shortcuts = psz_last_shortcut = strdup( psz_name );
- for( psz_parser = psz_shortcuts; *psz_parser; psz_parser++ )
+ while( ( psz_parser = strchr( psz_parser, ',' ) ) )
{
- if( *psz_parser == ',' )
- {
- *psz_parser = '\0';
- i_shortcuts++;
- psz_last_shortcut = psz_parser + 1;
- }
+ *psz_parser = '\0';
+ i_shortcuts++;
+ psz_last_shortcut = ++psz_parser;
}
/* Check if the user wants to override the "strict" mode */
size_t count;
module_t **p_all = module_list_get (&count);
p_list = malloc( count * sizeof( module_list_t ) );
- unsigned i_cpu = vlc_CPU();
/* Parse the module list for capabilities and probe each of them */
count = 0;
/* Test that this module can do what we need */
if( !module_provides( p_module, psz_capability ) )
continue;
- /* Test if we have the required CPU */
- if( (p_module->i_cpu & i_cpu) != p_module->i_cpu )
- continue;
/* If we required a shortcut, check this plugin provides it. */
if( i_shortcuts > 0 )
#endif
/* If the user provided a plugin path, we add it to the list */
- char *userpaths = config_GetPsz( p_this, "plugin-path" );
+ char *userpaths = var_InheritString( p_this, "plugin-path" );
char *paths_iter;
for( paths_iter = userpaths; paths_iter; )
break;
/* Skip ".", ".." */
- if (!strcmp (file, ".") || !strcmp (file, ".."))
+ if (!strcmp (file, ".") || !strcmp (file, "..")
+ /* Skip directories for unsupported optimizations */
+ || !vlc_CPU_CheckPluginDir (file))
{
free (file);
continue;