[vlc-devel] [PATCH 3/6] modules: inline vlc_module_unload() in module_need()

Steve Lhomme robux4 at ycbcr.xyz
Thu Jul 25 06:49:36 CEST 2019


It seems the git log doesn't match the code change.

On 2019-07-24 21:38, RĂ©mi Denis-Courmont wrote:
> This is much simpler.
> ---
>   src/modules/modules.c | 15 ++++++---------
>   1 file changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/src/modules/modules.c b/src/modules/modules.c
> index 9c5c4229a2..c8c19b1fd2 100644
> --- a/src/modules/modules.c
> +++ b/src/modules/modules.c
> @@ -261,14 +261,6 @@ static int generic_start(void *func, bool forced, va_list ap)
>       return ret;
>   }
>   
> -static void generic_stop(void *func, va_list ap)
> -{
> -    vlc_object_t *obj = va_arg(ap, vlc_object_t *);
> -    void (*deactivate)(vlc_object_t *) = func;
> -
> -    deactivate(obj);
> -}
> -
>   #undef module_need
>   module_t *module_need(vlc_object_t *obj, const char *cap, const char *name,
>                         bool strict)
> @@ -288,9 +280,14 @@ 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");
> -    vlc_module_unload(module, generic_stop, obj);
> +
> +    if (deactivate != NULL)
> +        deactivate(obj);
> +
>       vlc_objres_clear(obj);
>   }
>   
> -- 
> 2.22.0
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> 


More information about the vlc-devel mailing list