[MPlayer-dev-eng] [PATCH] better mplayer vs. gmplayer detection

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Fri Jul 7 13:29:41 CEST 2006


Hello,
the attached patch changes the check to only search for "gmplayer" in
the basename. Advantages: works under windows and also works with e.g.
gmplayer_old, useful when keeping old versions around.
This also means that people unsing windows will have to rename/copy
mplayer to gmplayer to get the gui, but I find this to be preferable
since it is consistent with the Linux version, and also try playing a
file named test-slave.avi with the current version...
Unless there are objections I will apply tomorrow.

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: mplayer.c
===================================================================
--- mplayer.c	(revision 18934)
+++ mplayer.c	(working copy)
@@ -2572,16 +2572,16 @@
   tv_param_immediate = 1;
 #endif
 
-#if defined(WIN32) && defined(HAVE_NEW_GUI)
-  char *cmdline = GetCommandLine();
-  if(!strstr(cmdline, "-slave"))
-    use_gui=1;
-#else
   if ( argv[0] )
-    if(!strcmp(argv[0],"gmplayer") ||
-      (strrchr(argv[0],'/') && !strcmp(strrchr(argv[0],'/'),"/gmplayer") ) )
+  {
+    char *base = strrchr(argv[0], '/');
+    if (!base)
+      base = strrchr(argv[0], '\\');
+    if (!base)
+      base = argv[0];
+    if(strstr(base, "gmplayer"))
           use_gui=1;
-#endif
+  }
 
     mconfig = m_config_new();
     m_config_register_options(mconfig,mplayer_opts);


More information about the MPlayer-dev-eng mailing list