]> git.sesse.net Git - vlc/blobdiff - src/modules/modules.c
Load/delete plugins cache from plugins directory
[vlc] / src / modules / modules.c
index 8c4d009e0d5a4417228ebf137d2707d531e74571..2dcf303236488fe1d01563b597a10de1a35a79c7 100644 (file)
@@ -200,7 +200,7 @@ void module_EndBank( vlc_object_t *p_this, bool b_plugins )
  * \param p_this vlc object structure
  * \return nothing
  */
-void module_LoadPlugins( vlc_object_t * p_this, bool b_cache_delete )
+void module_LoadPlugins( vlc_object_t * p_this )
 {
     module_bank_t *p_bank = p_module_bank;
 
@@ -213,8 +213,6 @@ void module_LoadPlugins( vlc_object_t * p_this, bool b_cache_delete )
         msg_Dbg( p_this, "checking plugin modules" );
         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 );
@@ -836,6 +834,7 @@ static void AllocateAllPlugins( vlc_object_t *p_this, module_bank_t *p_bank )
     int count,i;
     char * path;
     vlc_array_t *arraypaths = vlc_array_new();
+    const bool b_reset = var_InheritBool( p_this, "reset-plugins-cache" );
 
     /* Contruct the special search path for system that have a relocatable
      * executable. Set it to <vlc path>/modules and <vlc path>/plugins. */
@@ -866,6 +865,11 @@ static void AllocateAllPlugins( vlc_object_t *p_this, module_bank_t *p_bank )
         if( !path )
             continue;
 
+        if( b_reset )
+            CacheDelete( p_this, path );
+        else
+            CacheLoad( p_this, p_module_bank, path );
+
         msg_Dbg( p_this, "recursively browsing `%s'", path );
 
         /* Don't go deeper than 5 subdirectories */