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

Rafaël Carré rafael.carre at gmail.com
Wed Oct 20 16:17:31 CEST 2010


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
@@ -182,7 +193,7 @@ int main( int i_argc, const char *ppsz_argv[] )
     argv[argc++] = FromLocale ("--data-path="TOP_SRCDIR"/share");
 #endif
 
-    int i = 1;
+    i = 1;
 #ifdef __APPLE__
     /* When VLC.app is run by double clicking in Mac OS X, the 2nd arg
      * is the PSN - process serial number (a unique PID-ish thingie)
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index b6c74eb..2fc5136 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -2142,7 +2142,7 @@ vlc_module_begin ()
         change_safe()
     add_bool( "play-and-pause", 0, NULL, PAP_TEXT, PAP_LONGTEXT, true )
         change_safe()
-    add_bool( "media-library", 1, NULL, ML_TEXT, ML_LONGTEXT, false )
+    add_bool( "media-library", 0, NULL, ML_TEXT, ML_LONGTEXT, false )
 #if defined( MEDIA_LIBRARY )
     add_bool( "load-media-library-on-startup", 1, NULL, LOAD_ML_TEXT,
             LOAD_ML_LONGTEXT, false )
-- 
1.7.3.1





More information about the vlc-devel mailing list