[MPlayer-dev-eng] [PATCH] SDL widescreen modes
    Klokan Petr Pridal 
    xpridal at informatics.muni.cz
       
    Thu Jul  4 14:40:12 CEST 2002
    
    
  
Hi,
> > Besides the fact that the code is junk (it has some obvious bugs if I saw
> > correctly, eg = vs. ==), what's the use of it?
> Btw. I think my answer sounds a bit rude, wasn't meant to, sorry!
There was really this error. I'm ashamed, now I got a lammer stamp :-(. I hope it's not forever.
Thanks for your check-up, so the error was not published yet.
Repaired patch is included.
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