changeset 18939:cde5b56f1610

Change use_gui detection to accept also filenames only containing gmplayer, like "gmplayer.exe", "gmplayer_old" etc. Also removes (somewhat broken) WIN32 special-case
author reimar
date Sat, 08 Jul 2006 11:03:18 +0000
parents 70eec1cad080
children 530bca1ca585
files mplayer.c
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mplayer.c	Fri Jul 07 18:27:58 2006 +0000
+++ b/mplayer.c	Sat Jul 08 11:03:18 2006 +0000
@@ -2623,16 +2623,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);