[MPlayer-dev-eng] [PROBLEM] MacOSX and SDL in window mode

Felix Buenemann atmosfear at users.sourceforge.net
Tue Jun 11 04:57:21 CEST 2002


On Tuesday 11 June 2002 05:03, D Richard Felker III wrote:
> On Mon, Jun 10, 2002 at 10:32:48PM +0200, Felix Buenemann wrote:
> > On Monday 10 June 2002 19:56, Klokan Petr Pridal wrote:
> > > Some time ago I report here that MPlayer crashes when running on MacOSX
> > > with SDL and the mode is changed from (default) fullscreen to window. A
> > > problem is, that for running in window mode SDL need at startup of
> > > program some initialization. Normally this is done by automatic
> > > redefinition of main() function of program, when it includes "SDL.h". I
> > > this time MPlayer didn't this (resp. mplayer.c don't contain #include
> > > "SDL.h"). On other platforms are not problems? I tried adapt mplayer
> > > and after that it can ran window mode very well and switch between
> > > modes. But there are some other problems, so I didn't make a patch.
> > >
> > > So ofered solotion:
> > > It's possible to #include "SDL.h" in the mplayer.c in the future? You
> > > have to also remove from main() parametr "char *envp[]" and get this
> > > array another way (if it's used)...
> >
> > yes, you can do it make sure you have #ifdef HAVE_SDL around the include
> > of the .h file. You can remove envp in main parameter list and the
> > m_config_parse_command_line function, at it is not used at all (the only
> > thing is that if MP_DEBUG is used, it places an assertion on envp but
> > that can be removed, too). As you can see from this, it's used for
> > nothung really:
>
> This is bad. SDL should not be allowed to mangle main; this does bad
> things on Win32 (disabling stdin/out/err) and perhaps on other
> platforms as well. Any library that needs to mangle main to work is
> broken and needs to be fixed. Whatever crap is needed at startup would
> work just as well at SDL_Init() time. Perhaps you could grab the
> mac-specific initialization code it trashes main with and put that
> inside ao_/vo_sdl.c, with #ifdef MACOS.
Or simply use in mplayer.c #if defined(HAVE_SDL) && defined(__apple__) or 
whatever.


>
> Rich
-- 
Best Regards,
        Atmos
____________________________________________
- MPlayer Developer - http://mplayerhq.hu/ -
____________________________________________



More information about the MPlayer-dev-eng mailing list