[MPlayer-dev-eng] [PATCH] reintroduce -gui/-nogui options (hack!)

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sat Jul 8 13:24:58 CEST 2006


Hello,
hack to reintroduce these options. Normal parsing can't be used since
that happens to late (AFAIK, I didn't test what exactly the problems
are).
They can only be used as the first argument though.
Comments?

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: mplayer.c
===================================================================
--- mplayer.c	(revision 18944)
+++ mplayer.c	(working copy)
@@ -2623,6 +2623,13 @@
   tv_param_immediate = 1;
 #endif
 
+  if (argc > 1 && argv[1] &&
+      (!strcmp(argv[1], "-gui") || !strcmp(argv[1], "-nogui"))) {
+    use_gui = !strcmp(argv[1], "-gui");
+    argv[1] = argv[0];
+    argv++;
+    argc--;
+  } else
   if ( argv[0] )
   {
     char *base = strrchr(argv[0], '/');
Index: cfg-mplayer.h
===================================================================
--- cfg-mplayer.h	(revision 18944)
+++ cfg-mplayer.h	(working copy)
@@ -333,9 +333,8 @@
 	{"lircconf", &lirc_configfile, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL},
 #endif
 
-	{"gui", "Please remove gui=yes from your config file. Run gmplayer if you want the GUI.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
-//	{"gui", &use_gui, CONF_TYPE_FLAG, CONF_GLOBAL|CONF_NOCMD, 0, 1, NULL},
-//	{"nogui", &use_gui, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},
+	{"gui", "The -gui option can only be used as first commandline argument.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
+	{"nogui", "The -nogui option can only be used as first commandline argument.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
       
 #ifdef HAVE_NEW_GUI
 	{"skin", &skinName, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL},


More information about the MPlayer-dev-eng mailing list