From 2dc3b7951cc51e29b03ad1e9c9918ff9e9ef2f93 Mon Sep 17 00:00:00 2001 From: henry Date: Mon, 11 Nov 2002 16:14:28 +0000 Subject: [PATCH] fixed mode switching on Mac git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8150 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_sdl.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libvo/vo_sdl.c b/libvo/vo_sdl.c index 15a1ee1538..82fbec51e2 100644 --- a/libvo/vo_sdl.c +++ b/libvo/vo_sdl.c @@ -670,6 +670,14 @@ static void set_video_mode(int width, int height, int bpp, uint32_t sdlflags) 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 @@ static void set_fullmode (int mode) { 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) {