changeset 18105:954eac69b532

new monitorpixelaspect option, esp. useful for xinerama setups with upcoming patch
author reimar
date Sat, 15 Apr 2006 20:50:33 +0000
parents 7b408d60de9e
children 3a34a728fa1b
files DOCS/man/en/mplayer.1 cfg-mplayer.h libvo/aspect.c
diffstat 3 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/man/en/mplayer.1	Sat Apr 15 20:46:54 2006 +0000
+++ b/DOCS/man/en/mplayer.1	Sat Apr 15 20:50:33 2006 +0000
@@ -2505,6 +2505,13 @@
 .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, a value of 1 means square pixels
+(correct for (almost?) all LCDs).
+.
+.TP
 .B \-nodouble
 Disables double buffering, mostly for debugging purposes.
 Double buffering fixes flicker by storing two frames in memory, and
--- a/cfg-mplayer.h	Sat Apr 15 20:46:54 2006 +0000
+++ b/cfg-mplayer.h	Sat Apr 15 20:50:33 2006 +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},
--- a/libvo/aspect.c	Sat Apr 15 20:46:54 2006 +0000
+++ b/libvo/aspect.c	Sat Apr 15 20:50:33 2006 +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