[vlc-devel] [PATCH 1/5] modules: module_list_cap sort list using the name argument

Thomas Guillem thomas at gllm.fr
Thu Jun 4 10:34:32 CEST 2015

On Wed, Jun 3, 2015, at 18:44, Rémi Denis-Courmont wrote:
> Le mercredi 03 juin 2015, 17:35:41 Thomas Guillem a écrit :
> > This avoid to iterate in the list for each shortcuts from the name argument
> > since the list is already sorted with them.
> to avoid -ing
> to iterate (|through) smth
> to sort (according to|into)

Ok, thanks.

> > This will also allow to extend the vlc_module_load function in order to load
> > a module coming just after an other one.
> I don´t understand that sentence, nor do I understand the code.

Before, you would have to iterate through the sorted list for each
shortcuts coming from the name argument since it was sorted only by
priority. Now it's sorted by priority and by the name argument, so you
have to iterate only one time to find a module.

Imagine you have 3 decoder modules:
- hwdecoder1, priority 50
- hwdecoder2, priority 0
- avcodec, priority 70

If you don't specify any name, the list will be sorted like :
"avcodec,hwdecoder1,hwdecoder2" and hwdecoder2 won't be loaded unless
you set strict to false.

Now, if you specify ":codec=hwdecoder2,hwdecoder1,any" in the name
arguments (or any compatible shortcuts), the list will be sorted like

As the list is fully sorted, you know that you could try hwdecoder1 if
hwdecoder2 fails. See the next patch.

> Optimization of the module list is definitely possible, e.g. by
> pre-indexing 
> the list by capability at load time. But I don´t see how this relates to 
> decoder fallback.
> -- 
> Rémi Denis-Courmont
> http://www.remlab.net/
> _______________________________________________
> 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