From 25f38b560e61311e8956ad53e59f395d8e27153e Mon Sep 17 00:00:00 2001 From: atmos4 Date: Wed, 10 Oct 2001 01:03:54 +0000 Subject: Make double/normal (n-key) use aspect() git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2148 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_sdl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libvo/vo_sdl.c b/libvo/vo_sdl.c index 61415f8481..8e1e45510d 100644 --- a/libvo/vo_sdl.c +++ b/libvo/vo_sdl.c @@ -1084,14 +1084,16 @@ static void check_events (void) } else if ( keypressed == SDLK_n ) { - if (priv->surface->w != priv->width || priv->surface->h != priv->height) { - priv->surface = SDL_SetVideoMode(priv->width, priv->height, priv->bpp, priv->sdlflags); + int newwidth = priv->dstwidth, newheight = priv->dstheight; + aspect(&newwidth, &newheight, priv->dstwidth, (int)((float)priv->dstwidth*((float)priv->XHeight / (float)priv->XWidth))); + if (priv->surface->w != newwidth || priv->surface->h != newheight) { + priv->surface = SDL_SetVideoMode(newwidth, newheight, priv->bpp, priv->sdlflags); priv->windowsize.w = priv->surface->w; priv->windowsize.h = priv->surface->h; if(verbose > 1) printf("SDL: Normal size\n"); } else - if (priv->surface->w != priv->width * 2 || priv->surface->h != priv->height * 2) { - priv->surface = SDL_SetVideoMode(priv->width * 2, priv->height * 2, priv->bpp, priv->sdlflags); + if (priv->surface->w != newwidth * 2 || priv->surface->h != newheight * 2) { + priv->surface = SDL_SetVideoMode(newwidth * 2, newheight * 2, priv->bpp, priv->sdlflags); priv->windowsize.w = priv->surface->w; priv->windowsize.h = priv->surface->h; if(verbose > 1) printf("SDL: Double size\n"); -- cgit v1.2.3