[vlc-devel] [PATCH 3/7] modules: revector

Romain Vimont rom1v at videolabs.io
Fri Sep 25 17:36:44 CEST 2020


Revector?

On Thu, Sep 24, 2020 at 11:00:21PM +0300, RĂ©mi Denis-Courmont wrote:
> (no functional changes)
> ---
>  src/modules/modules.c | 27 +++++++++++++--------------
>  1 file changed, 13 insertions(+), 14 deletions(-)
> 
> diff --git a/src/modules/modules.c b/src/modules/modules.c
> index 653107b7c6..004e56c18f 100644
> --- a/src/modules/modules.c
> +++ b/src/modules/modules.c
> @@ -196,20 +196,10 @@ ssize_t vlc_module_match(const char *capability, const char *names,
>      return matches;
>  }
>  
> -static int module_load(vlc_logger_t *log, module_t *m,
> -                       vlc_activate_t init, bool forced, va_list args)
> +static
> +void *vlc_module_map(vlc_logger_t *log, module_t *module)
>  {
> -    va_list ap;
> -    int ret;
> -
> -    if (vlc_plugin_Map(log, m->plugin))
> -        return VLC_EGENERIC;
> -
> -    assert(m->pf_activate != NULL);
> -    va_copy(ap, args);
> -    ret = init(m->pf_activate, forced, ap);
> -    va_end(ap);
> -    return ret;
> +    return vlc_plugin_Map(log, module->plugin) ? NULL : module->pf_activate;
>  }
>  
>  /**
> @@ -258,7 +248,16 @@ module_t *(vlc_module_load)(struct vlc_logger *log, const char *capability,
>  
>      for (size_t i = 0; i < (size_t)total; i++) {
>          module_t *cand = mods[i];
> -        int ret = module_load(log, cand, probe, i < strict_total, args);
> +        int ret = VLC_EGENERIC;
> +        void *cb = vlc_module_map(log, cand);
> +
> +        if (cb != NULL) {
> +            va_list ap;
> +
> +            va_copy(ap, args);
> +            ret = probe(cb, i < strict_total, ap);
> +            va_end(ap);
> +        }
>  
>          switch (ret) {
>              case VLC_SUCCESS:
> -- 
> 2.28.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