[vlc-devel] [PATCH] Disable media-library by default

Rémi Denis-Courmont remi at remlab.net
Wed Oct 20 19:02:29 CEST 2010


Le mercredi 20 octobre 2010 17:17:31 Rafaël Carré, vous avez écrit :
> Enable it in vlc binary, unless an option for media-library was
> specified on command line
> ---
>  bin/vlc.c           |   13 ++++++++++++-
>  src/libvlc-module.c |    2 +-
>  2 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/bin/vlc.c b/bin/vlc.c
> index 085aa3a..24592e1 100644
> --- a/bin/vlc.c
> +++ b/bin/vlc.c
> @@ -31,6 +31,7 @@
> 
>  #include <vlc/vlc.h>
>  #include <stdio.h>
> +#include <string.h>
>  #include <stdlib.h>
>  #include <stdbool.h>
>  #include <locale.h>
> @@ -175,6 +176,16 @@ int main( int i_argc, const char *ppsz_argv[] )
>      int argc = 0;
> 
>      argv[argc++] = "--no-ignore-config";
> +    int i;
> +    for (i = 0; i < argc; i++)
> +    {
> +        if (!strcmp(argv[i], "--nomedia-library") ||
> +            !strcmp(argv[i], "--no-media-library") ||
> +            !strcmp(argv[i], "--media-library"))
> +            break;
> +    }
> +    if (i == argc)
> +        argv[argc++] = "--media-library";
>  #ifdef TOP_BUILDDIR
>      argv[argc++] = FromLocale ("--plugin-path="TOP_BUILDDIR"/modules");
>  #endif

Wouldn't it be an order of magnitude simpler to have vlc.c insert "--media-
library" in argv?

-- 
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis



More information about the vlc-devel mailing list