[vlc-commits] modules: remove useless parameters for static builds and fix them

Rémi Denis-Courmont git at videolan.org
Fri Oct 28 10:01:09 CEST 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Oct 28 11:00:42 2016 +0300| [0abd91c9dae2f2e3c0df373da8e9355807243576] | committer: Rémi Denis-Courmont

modules: remove useless parameters for static builds and fix them

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

 src/libvlc-module.c   | 4 ++++
 src/modules/bank.c    | 6 ++++--
 src/modules/entry.c   | 8 ++++++++
 src/modules/modules.h | 2 ++
 4 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 3b95d5c..38aad5b 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -1971,11 +1971,13 @@ vlc_module_begin ()
                 VOD_SERVER_LONGTEXT, true )
 
     set_section( N_("Plugins" ), NULL )
+#if HAVE_DYNAMIC_PLUGINS
     add_bool( "plugins-cache", true, PLUGINS_CACHE_TEXT,
               PLUGINS_CACHE_LONGTEXT, true )
     add_bool( "plugins-scan", true, PLUGINS_SCAN_TEXT,
               PLUGINS_SCAN_LONGTEXT, true )
     add_obsolete_string( "plugin-path" ) /* since 2.0.0 */
+#endif
     add_obsolete_string( "data-path" ) /* since 2.1.0 */
     add_string( "keystore", NULL, KEYSTORE_TEXT,
                 KEYSTORE_LONGTEXT, true )
@@ -2708,9 +2710,11 @@ vlc_module_begin ()
     add_obsolete_bool( "save-config" )
     add_bool( "reset-config", false, RESET_CONFIG_TEXT, "", false )
         change_volatile ()
+#ifdef HAVE_DYNAMIC_PLUGINS
     add_bool( "reset-plugins-cache", false,
               RESET_PLUGINS_CACHE_TEXT, "", false )
         change_volatile ()
+#endif
     add_bool( "version", false, VERSION_TEXT, "", false )
         change_volatile ()
     add_string( "config", NULL, CONFIG_TEXT, "", false )
diff --git a/src/modules/bank.c b/src/modules/bank.c
index 62ee779..3fff2bb 100644
--- a/src/modules/bank.c
+++ b/src/modules/bank.c
@@ -72,8 +72,10 @@ static vlc_plugin_t *module_InitStatic(vlc_plugin_cb entry)
     if (unlikely(lib == NULL))
         return NULL;
 
+#ifdef HAVE_DYNAMIC_PLUGINS
     atomic_init(&lib->loaded, true);
     lib->unloadable = false;
+#endif
     return lib;
 }
 
@@ -462,9 +464,9 @@ static void module_Unmap(vlc_plugin_t *plugin)
     module_Unload(plugin->handle);
 }
 #else
-int module_Map(vlc_object_t *obj, module_t *module)
+int module_Map(vlc_object_t *obj, vlc_plugin_t *plugin)
 {
-    (void) obj; (void) module;
+    (void) obj; (void) plugin;
     return 0;
 }
 
diff --git a/src/modules/entry.c b/src/modules/entry.c
index 2cfe201..4fc0362 100644
--- a/src/modules/entry.c
+++ b/src/modules/entry.c
@@ -104,12 +104,14 @@ vlc_plugin_t *vlc_plugin_create(void)
     plugin->conf.size = 0;
     plugin->conf.count = 0;
     plugin->conf.booleans = 0;
+#ifdef HAVE_DYNAMIC_PLUGINS
     plugin->abspath = NULL;
     atomic_init(&plugin->loaded, false);
     plugin->unloadable = true;
     plugin->handle = NULL;
     plugin->abspath = NULL;
     plugin->path = NULL;
+#endif
     plugin->module = NULL;
 
     return plugin;
@@ -123,14 +125,18 @@ vlc_plugin_t *vlc_plugin_create(void)
 void vlc_plugin_destroy(vlc_plugin_t *plugin)
 {
     assert(plugin != NULL);
+#ifdef HAVE_DYNAMIC_PLUGINS
     assert(!plugin->unloadable || !atomic_load(&plugin->loaded));
+#endif
 
     if (plugin->module != NULL)
         vlc_module_destroy(plugin->module);
 
     config_Free(plugin->conf.items, plugin->conf.size);
+#ifdef HAVE_DYNAMIC_PLUGINS
     free(plugin->abspath);
     free(plugin->path);
+#endif
     free(plugin);
 }
 
@@ -274,7 +280,9 @@ static int vlc_plugin_desc_cb(void *ctx, void *tgt, int propid, ...)
             break;
 
         case VLC_MODULE_NO_UNLOAD:
+#ifdef HAVE_DYNAMIC_PLUGINS
             plugin->unloadable = false;
+#endif
             break;
 
         case VLC_MODULE_NAME:
diff --git a/src/modules/modules.h b/src/modules/modules.h
index 72c711a..60a36e7 100644
--- a/src/modules/modules.h
+++ b/src/modules/modules.h
@@ -49,6 +49,7 @@ typedef struct vlc_plugin_t
         size_t booleans; /**< Number of booleal config items */
     } conf;
 
+#ifdef HAVE_DYNAMIC_PLUGINS
     atomic_bool loaded; /**< Whether the plug-in is mapped in memory */
     bool unloadable; /**< Whether the plug-in can be unloaded safely */
     module_handle_t handle; /**< Run-time linker handle (if loaded) */
@@ -57,6 +58,7 @@ typedef struct vlc_plugin_t
     char *path; /**< Relative path (within plug-in directory) */
     int64_t mtime; /**< Last modification time */
     uint64_t size; /**< File size */
+#endif
 } vlc_plugin_t;
 
 /**



More information about the vlc-commits mailing list