# HG changeset patch # User henry # Date 1037031268 0 # Node ID cf00aa6eb2d3dbe5b1ac896b4aa8dc378aecb4b2 # Parent 5b39e79af5fea6e5168e7d2446046672633dfb34 fixed mode switching on Mac diff -r 5b39e79af5fe -r cf00aa6eb2d3 libvo/vo_sdl.c --- 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) {