[MPlayer-dev-eng] Screen Area -vs- Video Area

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Aug 16 20:24:56 CEST 2011


On Tue, Aug 16, 2011 at 03:39:09AM -0400, Steaphan Greene wrote:
> There seems to be some confusion within the mplayer code about how to
> properly tell where the actual video is within the display area.  What I
> mean is, it seems that full-screen playback of videos with different
> aspect ratios than the screen itself (eg: 4x3 DVDs on a 16x9 display)
> causes overlay elements to be incorrectly positioned and sized, and
> mouse events to be incorrectly placed.
> 
> For example, the rescale_input_coordinates() function in command.c seems
> to be trying to use the vo_dwidth and vo_dwidth variables -vs- the
> vo_screenwidth and vo_screenheight variables to compensate for this for
> mouse events.  However that's not how these variables are actually setup
> by libvo/x11_common.c - so this seems to always fail.
> 
> Worse, with a 4x3 in 16x9 scenario:  With -vo xv, the mouse events are
> still wrong, but the DVD overlay graphics are correctly placed/sized.
> With -vo vdpau, the mouse events are still wrong, but now so are the
> positions and sizes of the DVD overlay graphics.
> 
> What is the "correct" way to properly tell where the video is within a
> larger area (particularly once -aspect and zooming come into play), and
> does anyone have a good idea how to go after getting everything to play
> along with that correctly?

That all was working once, so regression testing would be an option.
As for rescale_input_coordinates(): It should be using neither vo_fs nor
vo_screenwidth, instead it should use something like this (taken from
vo_gl):
    w = vo_dwidth;
    h = vo_dheight;
    aspect(&w, &h, A_WINZOOM);
    w += vo_panscan_x;
    h += vo_panscan_y;
    border_x = (vo_dwidth - new_w) / 2;
    border_y = (vo_dheight - new_h) / 2;
And use these to scale and translate appropriately.
Note that removing vo_fs check is important because there is already
code in MPlayer to support adding borders and panscan even in windowed
mode.
As for the other issue: vo_draw_text_ext was introduced to solve this,
vo_update_nav is supposed to take care of the necessary scaling and
translating.


More information about the MPlayer-dev-eng mailing list