[vlc-commits] modules: specify the deactivation callback type
Rémi Denis-Courmont
git at videolan.org
Thu Jul 25 18:52:54 CEST 2019
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jul 24 22:20:15 2019 +0300| [490172e79ca785bc223252c8a2936f4eae72aee4] | committer: Rémi Denis-Courmont
modules: specify the deactivation callback type
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=490172e79ca785bc223252c8a2936f4eae72aee4
---
src/modules/entry.c | 12 +++++++-----
src/modules/modules.c | 6 ++----
src/modules/modules.h | 2 +-
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/modules/entry.c b/src/modules/entry.c
index 8f76d9e06e..52326386e2 100644
--- a/src/modules/entry.c
+++ b/src/modules/entry.c
@@ -72,7 +72,7 @@ module_t *vlc_module_create(vlc_plugin_t *plugin)
module->activate_name = NULL;
module->deactivate_name = NULL;
module->pf_activate = NULL;
- module->pf_deactivate = NULL;
+ module->deactivate = NULL;
return module;
}
@@ -274,7 +274,7 @@ static int vlc_plugin_desc_cb(void *ctx, void *tgt, int propid, ...)
case VLC_MODULE_CB_CLOSE:
module->deactivate_name = va_arg(ap, const char *);
- module->pf_deactivate = va_arg (ap, void *);
+ module->deactivate = va_arg (ap, void *);
break;
case VLC_MODULE_NO_UNLOAD:
@@ -484,7 +484,6 @@ static int vlc_plugin_gpa_cb(void *ctx, void *tgt, int propid, ...)
switch (propid)
{
case VLC_MODULE_CB_OPEN:
- case VLC_MODULE_CB_CLOSE:
{
va_list ap;
@@ -576,14 +575,17 @@ int vlc_plugin_resolve(vlc_plugin_t *plugin, vlc_plugin_cb entry)
module != NULL;
module = module->next)
{
+ void *deactivate;
+
if (vlc_plugin_get_symbol(syms, module->activate_name,
&module->pf_activate)
- || vlc_plugin_get_symbol(syms, module->deactivate_name,
- &module->pf_deactivate))
+ || vlc_plugin_get_symbol(syms, module->deactivate_name, &deactivate))
{
ret = -1;
break;
}
+
+ module->deactivate = deactivate;
}
vlc_plugin_free_symbols(syms);
diff --git a/src/modules/modules.c b/src/modules/modules.c
index ac72e0fb26..2df5702f84 100644
--- a/src/modules/modules.c
+++ b/src/modules/modules.c
@@ -267,13 +267,11 @@ module_t *module_need(vlc_object_t *obj, const char *cap, const char *name,
#undef module_unneed
void module_unneed(vlc_object_t *obj, module_t *module)
{
- void (*deactivate)(vlc_object_t *) = module->pf_deactivate;
-
msg_Dbg(obj, "removing module \"%s\"", module_get_object(module));
var_Destroy(obj, "module-name");
- if (deactivate != NULL)
- deactivate(obj);
+ if (module->deactivate != NULL)
+ module->deactivate(obj);
vlc_objres_clear(obj);
}
diff --git a/src/modules/modules.h b/src/modules/modules.h
index 118a3aa7c4..264b40344c 100644
--- a/src/modules/modules.h
+++ b/src/modules/modules.h
@@ -95,7 +95,7 @@ struct module_t
const char *activate_name;
const char *deactivate_name;
void *pf_activate;
- void *pf_deactivate;
+ void (*deactivate)(vlc_object_t *);
};
vlc_plugin_t *vlc_plugin_create(void);
More information about the vlc-commits
mailing list