[MPlayer-dev-eng] [PATCH] mplayer has broken Letterboxing with xv Video Output on i3wm

Erik Auerswald auerswal at unix-ag.uni-kl.de
Sat May 7 14:10:12 EEST 2022


Hi all,

On 06.05.22 23:49, Tobias Girstmair wrote:
> 
> I'd like to propose the following patch, which fixes a problem with
> tiling window managers. The patch should apply on both the 1.5 release,
> as well as todays svn snapshot; happy to resubmit if there are problems.
> 
> Background:
>    i3wm is a tiling window manager, meaning it force-resizes windows to
>    fit into a grid. mplayer's xv backend doesn't draw letterboxes unless
>    fullscreen is enabled, since it doesn't anticipate that its requested
>    window size is overridden. This causes other windows' contents to
>    appear in the mplayer window when switching workspaces, since the
>    regions outside the video are not redrawn.

Thanks, I have a similar problem with GNOME when maximizing the
video window instead of using MPlayer's fullscreen functionality.

For reference, I reported this in April 2019, but did not find
a fix for the problem myself.  See the email thread from:
https://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2019-April/073751.html

As advised back then I am using -vo gl as a workaround currently.

> Solution:
>    Remove the `if ( vo_fs )` gate in `void vo_xv_draw_colorkey(...)` in
>    libvo/x11_common.c:2361.
>    Since this function assumed the window is screen sized, it now draws
>    oversized boxes. I modified it to use window width/height instead, so
>    it only draw the pixels needed.
> 
> Steps to Reproduce:
>    - use i3wm or another tiling window manager
>    - play a video with mplayer -vo xv $FILE
>    - switch workspaces back and forth
>    - notice that the empty space around the video is now corrupted.

A different way to reproduce the problem on GNOME:

   - play video with: mplayer -nofs -vo xv $VIDEO
   - maximize the video window
   - notice missing black boxes around the video

The patch against MPlayer version 1.5 applies cleanly to current
SVN revision r38366.

I have tried out the patch.  It works for me, at least with the
two test videos I have tried so far.

:-)

Thanks,
Erik


More information about the MPlayer-dev-eng mailing list