[vlc-devel] [vlc-commits] modules: store object name in a variable
Thomas Guillem
thomas at gllm.fr
Mon Mar 4 17:39:59 CET 2019
On Mon, Mar 4, 2019, at 17:30, Rémi Denis-Courmont wrote:
> 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
Thanks a lot for adding the module name back.
>
> > 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));
> + }
Why not putting that in vlc_module_load ?
I could be very useful for us to know if someone is using directsound or wasapi for example.
> + 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);
> }
>
>
> _______________________________________________
> vlc-commits mailing list
> vlc-commits at videolan.org
> https://mailman.videolan.org/listinfo/vlc-commits
>
More information about the vlc-devel
mailing list