[Mplayer-cvslog] CVS: main/libvo vo_sdl.c,1.90,1.91

Atmosfear atmos4 at mplayerhq.hu
Sat Aug 31 17:04:21 CEST 2002


Update of /cvsroot/mplayer/main/libvo
In directory mail:/var/tmp.root/cvs-serv1902/libvo

Modified Files:
	vo_sdl.c 
Log Message:
Improved MacOS X SDL support, enable SDL main() wrapper for Darwin, remove unused envp.
Patch by Donnie Smith <xc0bead2d8130df59 at f4n.org>, updated by me.


Index: vo_sdl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_sdl.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -r1.90 -r1.91
--- vo_sdl.c	28 Aug 2002 21:32:32 -0000	1.90
+++ vo_sdl.c	31 Aug 2002 15:04:18 -0000	1.91
@@ -731,6 +731,29 @@
 	/* 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) {




More information about the MPlayer-cvslog mailing list