changeset 8149:cf00aa6eb2d3

fixed mode switching on Mac
author henry
date Mon, 11 Nov 2002 16:14:28 +0000
parents 5b39e79af5fe
children 851e974e6eaa
files libvo/vo_sdl.c
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_sdl.c	Mon Nov 11 15:22:10 2002 +0000
+++ b/libvo/vo_sdl.c	Mon Nov 11 16:14:28 2002 +0000
@@ -670,6 +670,14 @@
 	struct sdl_priv_s *priv = &sdl_priv;
     SDL_Surface* newsurface;    
 
+    if(priv->rgbsurface)
+	SDL_FreeSurface(priv->rgbsurface);
+    else if(priv->overlay)
+	SDL_FreeYUVOverlay(priv->overlay);
+ 
+    priv->rgbsurface = NULL;
+    priv->overlay = NULL;
+ 
     newsurface = SDL_SetVideoMode(width, height, bpp, sdlflags);
 
     if(newsurface) {
@@ -693,6 +701,14 @@
 	SDL_Surface *newsurface = NULL;
  	int screen_surface_w, screen_surface_h;
 	
+ 	if(priv->rgbsurface)
+	        SDL_FreeSurface(priv->rgbsurface);
+ 	else if(priv->overlay)
+	        SDL_FreeYUVOverlay(priv->overlay);
+ 
+ 	priv->rgbsurface = NULL;
+ 	priv->overlay = NULL;
+ 
 	/* if we haven't set a fullmode yet, default to the lowest res fullmode first */
 	/* But select a mode where the full video enter */
 	if(priv->X && priv->fulltype & FS) {