[vlc-commits] modules: store object name in a variable
Rémi Denis-Courmont
git at videolan.org
Mon Mar 4 17:30:50 CET 2019
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Mar 4 18:18:46 2019 +0200| [38545d874a4952eada17b3dfe07b793cbaa705fd] | committer: Rémi Denis-Courmont
modules: store object name in a variable
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=38545d874a4952eada17b3dfe07b793cbaa705fd
---
src/modules/modules.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/modules/modules.c b/src/modules/modules.c
index 9c3ce314c4..6d493e5e31 100644
--- a/src/modules/modules.c
+++ b/src/modules/modules.c
@@ -332,13 +332,20 @@ static void generic_stop(void *func, va_list ap)
module_t *module_need(vlc_object_t *obj, const char *cap, const char *name,
bool strict)
{
- return vlc_module_load(obj, cap, name, strict, generic_start, obj);
+ module_t *module = vlc_module_load(obj, cap, name, strict,
+ generic_start, obj);
+ if (module != NULL) {
+ var_Create(obj, "module-name", VLC_VAR_STRING);
+ var_SetString(obj, "module-name", module_get_object(module));
+ }
+ return module;
}
#undef module_unneed
void module_unneed(vlc_object_t *obj, module_t *module)
{
msg_Dbg(obj, "removing module \"%s\"", module_get_object(module));
+ var_Destroy(obj, "module-name");
vlc_module_unload(obj, module, generic_stop, obj);
}
More information about the vlc-commits
mailing list