[MPlayer-cygwin] What about CreateThread patch?

Sergey sergemp at mail.ru
Tue Apr 3 01:16:36 CEST 2007


Hello, mplayer-cygwin.

  What about this patch for win32 GUI? Without this patch mplayer GUI
does not start at least under Win98 SE (tested on two win98 machines,
can also check on several WinME).
  With this patch applied GUI works.

  From MSDN: http://msdn2.microsoft.com/en-us/library/ms682453.aspx
    lpThreadId
    [out] A pointer to a variable that receives the thread identifier.
    If this parameter is NULL, the thread identifier is not returned.
    Windows Me/98/95:  This parameter may not be NULL.

--- mplayer/Gui/win32/interface.c   Sat Oct 14 03:31:58 2006
+++ mplayer.my/Gui/win32/interface.c    Mon Nov  6 02:34:08 2006
@@ -453,11 +453,12 @@

 void guiInit(void)
 {
+    DWORD threadId; // required for CreateThread under win9x/ME
     memset(&guiIntfStruct, 0, sizeof(guiIntfStruct));
     /* Create The gui thread */
     if (!mygui)
         mp_msg(MSGT_GPLAYER, MSGL_V, "[GUI] Creating GUI Thread 0x%04x\n",
-              (int) CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) GuiThread, NULL, 0, NULL));
+              (int) CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) GuiThread, NULL, 0, &threadId));

     /* Wait until the gui is created */
     while(!mygui) Sleep(100);
****** end of patch

Log of my old Gui revision:
---------------------------------------------------------------------
MPlayer dev-SVN-r22623-4.2.0 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Pentium(R) 4 CPU 2.80GHz (Family: 15, Model: 2, Stepping: 9)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled with runtime CPU detection.
Creating config file: D:/MPLAYER/MINGW/SRC/GMPLAYER-NOPATCHES/mplayer/config
Setting process priority: high
get_path('codecs.conf') -> 'D:/MPLAYER/MINGW/SRC/GMPLAYER-NOPATCHES/mplayer/codecs.conf'
Reading D:/MPLAYER/MINGW/SRC/GMPLAYER-NOPATCHES/mplayer/codecs.conf: Can't open 'D:/MPLAYER/MINGW/SRC/GMPLAYER-NOPATCHES/mplayer/codecs.conf': No such file or directory
Reading /local/etc/mplayer/codecs.conf: Can't open '/local/etc/mplayer/codecs.conf': No such file or directory
Using built-in default codecs.conf.
Configuration: --prefix=/local --enable-runtime-cpudetection --codecsdir=codecs --enable-menu --disable-dvdnav --with-extraincdir=/local/include --with-extralibdir=/local/lib --disable-mencoder --enable-gui --extra-libs=-mwindows
CommandLine: '-v'
init_freetype
get_path('font/font.desc') -> 'D:/MPLAYER/MINGW/SRC/GMPLAYER-NOPATCHES/mplayer/font/font.desc'
font: can't open file: D:/MPLAYER/MINGW/SRC/GMPLAYER-NOPATCHES/mplayer/font/font.desc
font: can't open file: /local/share/mplayer/font/font.desc
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
get_path('fonts') -> 'D:/MPLAYER/MINGW/SRC/GMPLAYER-NOPATCHES/mplayer/fonts'
Using Windows native timing
get_path('input.conf') -> 'D:/MPLAYER/MINGW/SRC/GMPLAYER-NOPATCHES/mplayer/input.conf'
Parsing input config file D:/MPLAYER/MINGW/SRC/GMPLAYER-NOPATCHES/mplayer/input.conf
Input config file D:/MPLAYER/MINGW/SRC/GMPLAYER-NOPATCHES/mplayer/input.conf parsed: 67 binds
[GUI] Creating GUI Thread 0x0000
---------------------------------------------------------------------
On that line gmplayer hangs forever.

Similar log of recent Gui build from oss.netfarm.it:
---------------------------------------------------------------------
MPlayer Sherpya-SVN-r22870-4.1.2 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Pentium(R) 4 CPU 2.80GHz (Family: 15, Model: 2, Stepping: 9)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
get_path('codecs.conf') -> 'D:/MPLAYER/NETFARM/GMPLAYER/mplayer/codecs.conf'
Reading D:/MPLAYER/NETFARM/GMPLAYER/mplayer/codecs.conf: Can't open 'D:/MPLAYER/NETFARM/GMPLAYER/mplayer/codecs.conf': No such file or directory
Reading /usr/etc/mplayer/codecs.conf: Can't open '/usr/etc/mplayer/codecs.conf': No such file or directory
Using built-in default codecs.conf.
Configuration: --enable-runtime-cpudetection --extra-libs=-mwindows --prefix=/usr --language=all --enable-static --enable-win32dll --enable-gui --enable-png --enable-md5sum --enable-menu --enable-qtx --enable-real --with-extraincdir=/j/Devel/mplayer/live --disable-mencoder --disable-jpeg --disable-gif --disable-tga --disable-liblzo --disable-tv --disable-dvb --disable-dvbhead --disable-vidix-internal --disable-sdl --disable-pnm --disable-xvid --disable-x264 --disable-toolame --disable-twolame --disable-mad --disable-gl --disable-caca
CommandLine: '-v'
init_freetype
get_path('font/font.desc') -> 'D:/MPLAYER/NETFARM/GMPLAYER/mplayer/font/font.desc'
font: can't open file: D:/MPLAYER/NETFARM/GMPLAYER/mplayer/font/font.desc
font: can't open file: /usr/share/mplayer/font/font.desc
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
get_path('fonts') -> 'D:/MPLAYER/NETFARM/GMPLAYER/mplayer/fonts'
Using Windows native timing
get_path('input.conf') -> 'D:/MPLAYER/NETFARM/GMPLAYER/mplayer/input.conf'
Parsing input config file D:/MPLAYER/NETFARM/GMPLAYER/mplayer/input.conf
Input config file D:/MPLAYER/NETFARM/GMPLAYER/mplayer/input.conf parsed: 42 binds
[GUI] Creating GUI Thread 0x0000
---------------------------------------------------------------------

-- 
  Sergey




More information about the MPlayer-cygwin mailing list