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

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Jul 10 18:05:05 CEST 2006


Hello,
On Sun, Jul 09, 2006 at 05:17:52PM +0300, Ivan Kalvachev wrote:
> 2006/7/8, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> >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?
> 
> Do we really need to hack the argv ?

If this is your only objection, what would you think about the attached
patch?
The text could be improved e.g. adding a "WARNING", and maybe it can be
made translateable?

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: mplayer.c
===================================================================
--- mplayer.c	(revision 18998)
+++ mplayer.c	(working copy)
@@ -2624,6 +2624,10 @@
   tv_param_immediate = 1;
 #endif
 
+  if (argc > 1 && argv[1] &&
+      (!strcmp(argv[1], "-gui") || !strcmp(argv[1], "-nogui"))) {
+    use_gui = !strcmp(argv[1], "-gui");
+  } else
   if ( argv[0] )
   {
     char *base = strrchr(argv[0], '/');
Index: cfg-mplayer.h
===================================================================
--- cfg-mplayer.h	(revision 18998)
+++ 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 will only work as first commandline argument.\n", CONF_TYPE_PRINT, 0, 0, 0, (void *)1},
+	{"nogui", "The -nogui option will only work as first commandline argument.\n", CONF_TYPE_PRINT, 0, 0, 0, (void *)1},
       
 #ifdef HAVE_NEW_GUI
 	{"skin", &skinName, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL},


More information about the MPlayer-dev-eng mailing list