[MPlayer-dev-eng] [PATCH] Possible SDL aspect bug, quick workaround

Fredrik Roubert roubert at df.lth.se
Tue May 20 22:41:56 CEST 2003


Hi!

I've been experiencing some wierd behaviour when using -vo sdl:dga and
today I finally spent some time to track down the problem.

I'm not sure wheter this is an actual bug in MPlayer, or if I just don't
understand how MPlayer is supposed to work well enough. However, this
causes a lot (maybe most) of my files to be scaled when played in
fullscreen mode (sdl:dga), which is a big performance penalty on the
system I'm using.

The attached short patch (only three changes in vo_sdl.c) will change the
behaviour of MPlayer, so that aspect calculations are only carried out
when using SDL if -zoom is also specified on the command line. (I don't
think that this will break anything.)

Even if there is no bug in the aspect calculating code, this is a useful
feature for us who have systems that are slow on scaling movies.

Now, to the thing I find strange:


mplayer -vo sdl:dga -v aliens.avi >& debug

MPlayer dev-CVS-030520-17:25-3.2.3 (C) 2000-2003 Arpad Gereoffy (see DOCS)

[ffmpeg] aspect_ratio: 0.000000
VDec: vo config request - 720 x 480 (preferred csp: Planar YV12)
Trying filter chain: vo
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO Config (720x480->720x480,flags=0,'MPlayer',0x32315659)
VO: [sdl] 720x480 => 720x480 Planar YV12
VO: Description: SDL YUV/RGB/BGR renderer (SDL v1.1.7+ only!)
VO: Author: Ryan C. Gordon <icculus at lokigames.com>, Felix Buenemann <atmosfear at users.sourceforge.net>
aspect: Warning: no suitable new res found!
SDL: Using 0x32315659 (Planar YV12) image format
aspect_save_orig 720x480
aspect_save_prescale 720x480
SDL: using hardware-surface
aspect_save_screenres 1024x768
aspect(0) fitin: 1024x768 zoom: 0 screenaspect: 1.33
aspect(1) wh: 720x480 (org: 720x480)
aspect(2) wh: 720x480 (org: 720x480)
aspect(3) wh: 720x480 (org: 720x480)
SDL: setting zoomed fullscreen with modeswitching
SDL Mode: 0:  1024 x 768
SDL Mode: 1:  800 x 600
SDL Mode: 2:  768 x 576
SDL Mode: 3:  720 x 576
SDL Mode: 4:  720 x 480
SDL Mode: 5:  640 x 480
SDL Mode: 6:  584 x 438
SDL Mode: 7:  400 x 300
SDL Mode: 8:  352 x 288
SDL Mode: 9:  352 x 240
SDL Mode: 10:  320 x 240
SET SDL Mode: 4:  720 x 480
aspect_save_screenres 720x480
aspect(0) fitin: 720x480 zoom: 1 screenaspect: 1.33
aspect(1) wh: 720x480 (org: 720x480)
aspect(2) wh: 720x426 (org: 720x480)
aspect(3) wh: 720x426 (org: 720x480)
*** [vo] Allocating (slices) mp_image_t, 720x480x12bpp YUV planar, 518400 bytes
*** [vo] Allocating (slices) mp_image_t, 720x480x12bpp YUV planar, 518400 bytes


The movie has a resolution of 720x480 and I would expect MPlayer to play
it in a 720x480 video mode directly, without scaling. Instead, the movie
is scaled to 720x426 (which makes it ugly and very slow on my system).

Cheers // Fredrik Roubert

-- 
Möllevångsvägen 6c  |  +46 46 188127
SE-222 40 Lund      |  http://www.df.lth.se/~roubert/
-------------- next part --------------
--- main.org/libvo/vo_sdl.c	Wed Apr  9 19:05:35 2003
+++ main/libvo/vo_sdl.c	Tue May 20 22:36:38 2003
@@ -124,7 +124,7 @@
 #include "../input/input.h"
 #include "../input/mouse.h"
 
-extern int verbose;
+extern int verbose, softzoom;
 int sdl_noxv;
 int sdl_forcexv;
 
@@ -727,7 +727,8 @@
         if(priv->fulltype&FS)
 		aspect_save_screenres(priv->XWidth, priv->XHeight);
 
-        aspect(&priv->dstwidth, &priv->dstheight, A_ZOOM);
+	if(softzoom)
+		aspect(&priv->dstwidth, &priv->dstheight, A_ZOOM);
 	}
 
 	/* try to change to given fullscreenmode */


More information about the MPlayer-dev-eng mailing list