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

Felix Buenemann atmosfear at users.sourceforge.net
Mon Jun 10 22:32:48 CEST 2002


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:

---snip---
atmosfear at astral:~/develop/mplayer/main> grep -n envp *.[ch]
cfgparser.c:992:int m_config_parse_command_line(m_config_t *config, int argc, 
char **argv, char **envp)
cfgparser.c:1003:       assert(envp != NULL);
cfgparser.h:96:int m_config_parse_command_line(m_config_t* config, int argc, 
char **argv, char **envp);
mencoder.c:293:int main(int argc,char* argv[], char *envp[]){
mencoder.c:372:  if(m_config_parse_command_line(mconfig, argc, argv, envp) < 
0) mencoder_exit(1, "error parsing cmdline");
mplayer.c:474:int main(int argc,char* argv[], char *envp[]){
mplayer.c:589:    if(m_config_parse_command_line(mconfig, argc, argv, envp) < 
0) exit(1); // error parsing cmdline
---snip---

>There is also need to add window mode as
> default for driver "Quartz" on line 896 in libvo/vo_sdl.c.
Yes, please do it. I already noticed, but didn't know driver name for osx.

>
> Normaly It runs perfect in the window. (And look like really good on MacOSX
> Aqua Blue desktop :-), I can send a screenshot...)
Please do!

>
> If you have new (buggy) QuickTime 6.0 beta, the content of window is not
> updated. Only when another window is draged over the content it is changed
> the right way. The same do VLC client.
Could you write some MacOS X howto for mplayer where this stuff is mentioned?

>
> By pressing c you can switch to different fullscreen resolution, but there
> is only a black board, but don't crash :-)). (BTW "c" key don't run before
> SDL.h was in the mplayer.c, so I think SDL_InitSubSystem() could run, but I
> can mistake) When you are going back to window mode you crash and got this
> message: kCGErrorIllegalArgument : CGSRemoveSurface: Invalid window
> MPlayer interrupted by signal 10 in module: vo_check_events
> vo: x11 uninit called but X11 not inited..
>
> By pressing n (for double size window) it will crash with SDL erors:
> kCGErrorIllegalArgument : CGSLockWindowRectBits: Invalid window
> kCGErrorIllegalArgument : CGSRemoveSurface: Invalid window
I can't help you with this, unless I have such system myself, only try to 
enable locks in vo_sdl and maybe try to free all existing surfaces before you 
init a new one, not sure how it looks like now.

>
> When running fullscreen from commandline I got new errors...
> mplayer -fs -vo sdl: mplayer change resolution to fullscreen but after that
> crashes with: SDL: Using 0x32315659 (Planar YV12) image format
> SDL: Using driver: Quartz
> SDL: using hardware-surface
> SDL: setting zoomed fullscreen without modeswitching
> SDL: Info - please use -vm or -zoom to switch to best resolution.
> *** malloc_zone_malloc[12506]: argument too large: -2536
> *** malloc_zone_malloc[12506]: argument too large: -2560
> SDL: Couldn't create a YUV overlay: Out of memory
> *** [vo] Exporting mp_image_t, 640x304x12bpp YUV planar, 291840 bytes
> MPlayer interrupted by signal 10 in module: decode_video
>
> I can work on this... and I will, but if somebody would help I'll be glad.
Sorry I can't trace this stuff without access to such system, maybe I can if I 
have ssh access to a system where I can run MPlayer with sdl.

> It this time we have exams on our university.
Me too - final exams-  only not at university but college.

> Have a nice day/night :-)
>
> Klokan

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



More information about the MPlayer-dev-eng mailing list