# HG changeset patch # User reimar # Date 1287329013 0 # Node ID d1f6c6cf89052c37b3431ad265918a6ddf4ecf43 # Parent a14dd8b8d314ab609dc6e6445a8f8524d99a837a Move gui-specific code out of common_init, it certainly does not belong there. diff -r a14dd8b8d314 -r d1f6c6cf8905 mpcommon.c --- a/mpcommon.c Sun Oct 17 15:17:46 2010 +0000 +++ b/mpcommon.c Sun Oct 17 15:23:33 2010 +0000 @@ -396,25 +396,9 @@ */ 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 diff -r a14dd8b8d314 -r d1f6c6cf8905 mplayer.c --- a/mplayer.c Sun Oct 17 15:17:46 2010 +0000 +++ b/mplayer.c Sun Oct 17 15:23:33 2010 +0000 @@ -2795,6 +2795,20 @@ } 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);