[MPlayer-dev-eng] [PATCH] Fix windows background clearing.

Ivan Kalvachev ikalvachev at gmail.com
Wed May 25 23:16:47 CEST 2011


A user complained that when resizing makes mplayer xv window flicker horribly.
This urged me to investigate the matter and I managed to find the reasons.

The first reason is that background color for the window is set. This
way when it is resized it automatically is painted black. Painting
black and then putting the video image over it is what causes the
flickering over the whole image. Have in mind that vsync may (or may
not) affect how visible is that.

Removing the background color drawing improved the flickering, but it
did not removed it. There was some flickering with strange proportions
over the image. It turned out that the function
vo_x11_clearwindow_part() messes up calculation of what should be
cleared and also draws into the image area. I didn't bother fixing it
as the vo_xv_draw_colorkey() already have code that clears the areas
around the video image (in fullscreen). So far in window mode image
covers the whole window, so nothing to clear in that case.
I just removed the use of that function in xv.

I also removed the vo_x11_clearwindow_part() usage from vo_x11. Now
the whole windows would be cleared not only on resize but also on
expose. While it would cause flicker it would at least clear the whole
window.
I have added explicit clearwindow and on window creation. While
xv/xvmc can always scale, x11 needs -zoom option, thus it can have
window that is bigger than the image. (The content under the window
remained in the areas that were not cleared, quite visible with videos
that need scaling).

I have not tested it with -wid, I would be glad if at least some of
the front-end developers could test it.

I'm not really sure if the patch should be split on 2 commits. It
doesn't really matter to me.

Here is proposed commit message:
------
Fix x11/xv/xvmc window background clearing.
Set background color only when using ck-method=background. In the
other cases clearing of the non-video image area should be done
manually. Not drawing on the video image area prevents flickering
(visible when resizing).
In vo_x11 driver, clear the whole window at creation and when
resizing. Fixes areas that are not properly cleared.
------

Best Regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bgrd.patch
Type: application/octet-stream
Size: 2944 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110526/ce1d986a/attachment.obj>


More information about the MPlayer-dev-eng mailing list