fixed mode switching on Mac

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8150 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
henry 2002-11-11 16:14:28 +00:00
parent 6811f96358
commit 2dc3b7951c
1 changed files with 16 additions and 0 deletions

View File

@ -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) {