diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index d2dde641e8..e357a13be8 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -2505,6 +2505,13 @@ Set the aspect ratio of your monitor or TV screen. .PD 1 . .TP +.B \-monitorpixelaspect (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 diff --git a/cfg-mplayer.h b/cfg-mplayer.h index c5a103684b..f908e1e93b 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -109,6 +109,7 @@ extern int nortc; /* 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 @@ m_option_t mplayer_opts[]={ {"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}, diff --git a/libvo/aspect.c b/libvo/aspect.c index 05c729baf3..0ecf02e858 100644 --- a/libvo/aspect.c +++ b/libvo/aspect.c @@ -19,6 +19,7 @@ float vo_panscanrange = 1.0; #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 @@ void aspect_save_screenres(int scrw, int scrh){ #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