[vlc-commits] Store the plugin file name in the cache once rather than twice

Rémi Denis-Courmont git at videolan.org
Sat Aug 13 22:13:19 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Aug 13 23:12:39 2011 +0300| [babd97c1004c80dc58740b5c02f6a5be003608b4] | committer: Rémi Denis-Courmont

Store the plugin file name in the cache once rather than twice

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=babd97c1004c80dc58740b5c02f6a5be003608b4
---

 src/modules/cache.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/modules/cache.c b/src/modules/cache.c
index bf3ce4b..16997a0 100644
--- a/src/modules/cache.c
+++ b/src/modules/cache.c
@@ -229,7 +229,6 @@ size_t CacheLoad( vlc_object_t *p_this, const char *dir, module_cache_t **r )
         if (CacheLoadConfig (module, file) != VLC_SUCCESS)
             goto error;
 
-        LOAD_STRING(module->psz_filename);
         LOAD_STRING(module->domain);
         if (module->domain != NULL)
             vlc_bindtextdomain (module->domain);
@@ -515,7 +514,6 @@ static int CacheSaveBank (FILE *file, const module_cache_t *cache,
         if (CacheSaveConfig (file, module))
             goto error;
 
-        SAVE_STRING(module->psz_filename);
         SAVE_STRING(module->domain);
 
         i_submodule = module->submodule_count;
@@ -649,12 +647,16 @@ module_t *CacheFind (module_cache_t *cache, size_t count,
 {
     while (count > 0)
     {
-        if (!strcmp (cache->path, path)
+        if (cache->path != NULL
+         && !strcmp (cache->path, path)
          && cache->mtime == st->st_mtime
          && cache->size == st->st_size)
        {
             module_t *module = cache->p_module;
-            cache->p_module = NULL; /* Return NULL next time */
+            cache->p_module = NULL;
+
+            module->psz_filename = cache->path;
+            cache->path = NULL;
             return module;
        }
        cache++;



More information about the vlc-commits mailing list