[MPlayer-dev-eng] [PATCH] monitorpixelaspect option to supplement monitoraspect

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Fri Apr 14 14:40:15 CEST 2006


Hi,
maybe you saw that I've been looking a bit at properly supporting
multiple monitors.
In addition to being often requested, the attached patch should improve
this as well (esp. the case where widescreen LCD and a CRT are used
together).
I think it is so little code that it should be okay to apply.
Comments?

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.259
diff -u -r1.259 cfg-mplayer.h
--- cfg-mplayer.h	22 Mar 2006 16:35:16 -0000	1.259
+++ cfg-mplayer.h	14 Apr 2006 12:29:52 -0000
@@ -109,6 +109,7 @@
 
 /* from libvo/aspect.c */
 extern float monitor_aspect;
+extern float monitor_pixel_aspect;
 
 extern int sws_flags;
 extern int readPPOpt(void *conf, char *arg);
@@ -224,6 +225,7 @@
 	{"geometry", &vo_geometry, CONF_TYPE_STRING, 0, 0, 0, NULL},
 	// set aspect ratio of monitor - useful for 16:9 TVout
 	{"monitoraspect", &monitor_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.2, 9.0, NULL},
+	{"monitorpixelaspect", &monitor_pixel_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 9.0, NULL},
 	// video mode switching: (x11,xv,dga)
         {"vm", &vidmode, CONF_TYPE_FLAG, 0, 0, 1, NULL},
         {"novm", &vidmode, CONF_TYPE_FLAG, 0, 1, 0, NULL},
Index: libvo/aspect.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/aspect.c,v
retrieving revision 1.18
diff -u -r1.18 aspect.c
--- libvo/aspect.c	27 Sep 2005 08:32:36 -0000	1.18
+++ libvo/aspect.c	14 Apr 2006 12:29:52 -0000
@@ -19,6 +19,7 @@
 #include "video_out.h"
 
 float monitor_aspect=4.0/3.0;
+float monitor_pixel_aspect=0;
 extern float movie_aspect;
 
 static struct {
@@ -53,6 +54,8 @@
 #endif
   aspdat.scrw = scrw;
   aspdat.scrh = scrh;
+  if (monitor_pixel_aspect)
+    monitor_aspect = monitor_pixel_aspect * scrw / scrh;
 }
 
 /* aspect is called with the source resolution and the
Index: DOCS/man/en/mplayer.1
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/man/en/mplayer.1,v
retrieving revision 1.1253
diff -u -r1.1253 mplayer.1
--- DOCS/man/en/mplayer.1	13 Apr 2006 21:25:37 -0000	1.1253
+++ DOCS/man/en/mplayer.1	14 Apr 2006 12:30:33 -0000
@@ -2500,6 +2500,12 @@
 .PD 1
 .
 .TP
+.B \-monitorpixelaspect <ratio> (also see \-aspect)
+Set the aspect of a single pixel of your monitor or TV screen (default: disabled).
+Overrides the \-monitoraspect setting.
+A value of 0 disables, for most monitors and (almost?) all LCD, 1 is a good value.
+.
+.TP
 .B \-nodouble
 Disables double buffering, mostly for debugging purposes.
 Double buffering fixes flicker by storing two frames in memory, and


More information about the MPlayer-dev-eng mailing list