[vlc-devel] [PATCH] GSoC: lua services discovery, core part

Rémi Denis-Courmont remi at remlab.net
Sun Nov 8 21:25:53 CET 2009


--- a/src/modules/cache.c
+++ b/src/modules/cache.c
@@ -543,9 +543,17 @@ void CacheSave( vlc_object_t *p_this, module_bank_t 
*p_bank )
     i_cache = p_bank->i_cache;
     pp_cache = p_bank->pp_cache;
 
+    int i_uncacheable = 0;
+    for( int i = 0; i < i_cache; i++ )
+        if( !pp_cache[i]->p_module->b_cacheable )
+            i_uncacheable++;
+    i_cache -= i_uncacheable;
+
     if (fwrite( &i_cache, sizeof (i_cache), 1, file) != 1)
         goto error;
 
+    i_cache += i_uncacheable;

-= then += is really hackish. Use two variables or re-assign.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list