[MPlayer-cvslog] r32501 - in trunk: mpcommon.c mplayer.c

reimar subversion at mplayerhq.hu
Sun Oct 17 17:23:33 CEST 2010


Author: reimar
Date: Sun Oct 17 17:23:33 2010
New Revision: 32501

Log:
Move gui-specific code out of common_init, it certainly does
not belong there.

Modified:
   trunk/mpcommon.c
   trunk/mplayer.c

Modified: trunk/mpcommon.c
==============================================================================
--- trunk/mpcommon.c	Sun Oct 17 17:17:46 2010	(r32500)
+++ trunk/mpcommon.c	Sun Oct 17 17:23:33 2010	(r32501)
@@ -396,25 +396,9 @@ static void sanitize_os(void)
  */
 int common_init(void)
 {
-#if defined(__MINGW32__) || defined(__CYGWIN__)
-#ifdef CONFIG_WIN32DLL
+#if (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL)
     set_path_env();
 #endif
-#ifdef CONFIG_GUI
-    void *runningmplayer = FindWindow("MPlayer GUI for Windows", "MPlayer for Windows");
-    if (runningmplayer && filename && use_gui) {
-        COPYDATASTRUCT csData;
-        char file[MAX_PATH];
-        char *filepart = filename;
-        if (GetFullPathName(filename, MAX_PATH, file, &filepart)) {
-            csData.dwData = 0;
-            csData.cbData = strlen(file)*2;
-            csData.lpData = file;
-            SendMessage(runningmplayer, WM_COPYDATA, (WPARAM)runningmplayer, (LPARAM)&csData);
-        }
-    }
-#endif
-#endif
     sanitize_os();
 
 #ifdef CONFIG_PRIORITY

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	Sun Oct 17 17:17:46 2010	(r32500)
+++ trunk/mplayer.c	Sun Oct 17 17:23:33 2010	(r32501)
@@ -2795,6 +2795,20 @@ int gui_no_filename=0;
     }
 
   print_version("MPlayer");
+#if (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_GUI)
+    void *runningmplayer = FindWindow("MPlayer GUI for Windows", "MPlayer for Windows");
+    if (runningmplayer && filename && use_gui) {
+        COPYDATASTRUCT csData;
+        char file[MAX_PATH];
+        char *filepart = filename;
+        if (GetFullPathName(filename, MAX_PATH, file, &filepart)) {
+            csData.dwData = 0;
+            csData.cbData = strlen(file)*2;
+            csData.lpData = file;
+            SendMessage(runningmplayer, WM_COPYDATA, (WPARAM)runningmplayer, (LPARAM)&csData);
+        }
+    }
+#endif
     if (!common_init())
         exit_player_with_rc(EXIT_NONE, 0);
 


More information about the MPlayer-cvslog mailing list