[MPlayer-dev-eng] [PATCH] SDL widescreen modes

Klokan Petr Pridal xpridal at informatics.muni.cz
Tue Jun 11 03:24:42 CEST 2002


>  > Hi,
>  > 
>  > I made a patch to libvo/vo_sdl.c, which autoselect in the start a widescreen mode, if there is some. I thing it's pretty source, so it will be commited to CVS.
> 
> Please read DOCS/tech/patches.txt.  We need a unified diff to apply
> this to CVS.
Sorry, once more and better...

Klokan
-- 
 (\_/)    Klokan Petr Pridal
 (o o)    ----------------------------
  (.)     student FI MU Brno, webmaster http://www.linux.cz/
 (] [) _  mailto:klokan at seznam.cz
 {~~~}/ ) ICQ:3674202
(')  (')  http://klokan.misto.cz/
 \_)-(_)  Look at http://www.fi.muni.cz/~xpridal/
-------------- next part --------------
--- ../MPlayer-20020610/libvo/vo_sdl.c	Mon Apr 29 09:52:21 2002
+++ libvo/vo_sdl.c	Mon Jun 10 23:40:56 2002
@@ -699,15 +699,26 @@
 		screen_surface_h = priv->XHeight;
 	}
 	else if (mode < 0) {
-        int i;
-		mode = 0; // Default to the biggest mode avaible
+		int i;
+		if (verbose) for(i=0;priv->fullmodes[i];++i) 
+		  printf("Mode: %d:  %d x %d\n", i, priv->fullmodes[i]->w, priv->fullmodes[i]->h);
+		mode = 0; // Default to the biggest mode available
 		for(i = findArrayEnd(priv->fullmodes) - 1; i >=0; i--) {
+		  // Find the smallest suitable, prefer widescreen 
 		  if( (priv->fullmodes[i]->w >= priv->dstwidth) && 
 		      (priv->fullmodes[i]->h >= priv->dstheight) ) {
-		    mode = i;
-		    break;
+		    if( (priv->fullmodes[i-1]->w > priv->fullmodes[i]->w) && 
+		        (priv->fullmodes[i-1]->h = priv->fullmodes[i]->h) && (i != 0)) {
+		      mode = i-1;
+		      break;
+		    }
+		    else { 
+		      mode = i;
+		      break;
+		    }
 		  }
 		}
+		if (verbose) printf("SET Mode: %d:  %d x %d\n", mode, priv->fullmodes[mode]->w, priv->fullmodes[mode]->h);
 		priv->fullmode = mode;
         screen_surface_h = priv->fullmodes[mode]->h;
         screen_surface_w = priv->fullmodes[mode]->w;


More information about the MPlayer-dev-eng mailing list