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

Thomas Guillem thomas at gllm.fr
Fri Sep 25 21:17:59 CEST 2020


What does it mean? Why not refactor ?

On Fri, Sep 25, 2020, at 17:44, Rémi Denis-Courmont wrote:
> Yes?
> 
> Le 25 septembre 2020 18:36:44 GMT+03:00, Romain Vimont <rom1v at videolabs.io> a écrit :
>> 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.0vlc-devel mailing list
>>> To unsubscribe or modify your subscription options:
>>> https://mailman.videolan.org/listinfo/vlc-devel
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> 
> -- 
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté. 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20200925/e5fa0e82/attachment.html>


More information about the vlc-devel mailing list