diff options
author | atmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-08-31 15:04:18 +0000 |
---|---|---|
committer | atmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-08-31 15:04:18 +0000 |
commit | a63ea1a018ca781936dc0d4663b249676382844f (patch) | |
tree | fc476b9b3221705be7aad9d935edec29c2b0b0b6 /libvo/vo_sdl.c | |
parent | dc1ccbc50e06a6f87381c6a08bf6f2f79d5eeb25 (diff) | |
download | mpv-a63ea1a018ca781936dc0d4663b249676382844f.tar.bz2 mpv-a63ea1a018ca781936dc0d4663b249676382844f.tar.xz |
Improved MacOS X SDL support, enable SDL main() wrapper for Darwin, remove unused envp.
Patch by Donnie Smith <xc0bead2d8130df59@f4n.org>, updated by me.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7202 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_sdl.c')
-rw-r--r-- | libvo/vo_sdl.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libvo/vo_sdl.c b/libvo/vo_sdl.c index ba7070a9ce..5ca488c1c7 100644 --- a/libvo/vo_sdl.c +++ b/libvo/vo_sdl.c @@ -731,6 +731,29 @@ static void set_fullmode (int mode) { /* try to change to given fullscreenmode */ newsurface = SDL_SetVideoMode(priv->dstwidth, screen_surface_h, priv->bpp, priv->sdlfullflags); + + /* + * In Mac OS X (and possibly others?) SDL_SetVideoMode() appears to + * destroy the datastructure previously retrived, so we need to + * re-assign it. The comment in sdl_close() seems to imply that we + * should not free() anything. + */ + #ifdef SYS_DARWIN + { + const SDL_VideoInfo *vidInfo = NULL; + vidInfo = SDL_GetVideoInfo (); + + /* collect all fullscreen & hardware modes available */ + if (!(priv->fullmodes = SDL_ListModes (vidInfo->vfmt, priv->sdlfullflags))) { + + /* non hardware accelerated fullscreen modes */ + priv->sdlfullflags &= ~SDL_HWSURFACE; + priv->fullmodes = SDL_ListModes (vidInfo->vfmt, priv->sdlfullflags); + } + } + #endif + + /* if creation of new surface was successfull, save it and hide mouse cursor */ if(newsurface) { |