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

Ivan Kalvachev ikalvachev at gmail.com
Fri May 27 01:44:59 CEST 2011


On 5/26/11, Reimar Döffinger <Reimar.Doeffinger at gmx.de> wrote:
> On Thu, May 26, 2011 at 12:16:47AM +0300, Ivan Kalvachev wrote:
>> 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.
>
> Calling flip_page every time is not a good idea, it causes horrible
> performance both when slowly resizing the window and when dragging
> a different window over the video window.
> It was done on only on pause before for a very good reason.
> (I suspect there was also a reason why it was only done on expose
> and not resize, but I am not as certain there it was a good one).

I restored the old behavior.
I also found the bug that made clearwindow_part() produce wrong results.

In the vo_x11 case it got hardcoded parameter that it is in window
mode, thus always working properly in window mode and failing in
fullscreen mode.
I've fixed it by passing vo_fs variable as parameter.

In vo_xv case it was told that it is in fullscreen mode, thus always
clearing much more than needed when in window mode.
I've fixed it in the same way, but as this code is still redundant,
I've decided to comment it out until I come up with a more proper
solution.
(the _part() function was completely removed in my previous patch).


>> I have added explicit clearwindow and on window creation.
>
> Might make sense to move that into the function that creates the window,
> shouldn't really hurt.

Actually there already was such function, but for some reason it did
not produce any result. The change I presented just worked for me so I
didn't investigate.

However this is what I did after reading your response. It turned out
that the drawing command is ignored if the window is not mapped (Kind
of makes sense).
I moved the clearwin() after the loop that waits for the map event to
arrive and this seems to do the trick.


New patch attached.

Here is updated 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).

Fix x11_common to clear the newly created window after mapping it.
In vo_x11 driver -  pass the correct vo_fs parameter. It makes it
calculate correctly the areas outside the image that have to be
cleared.
------

I could still commit these as separate patches. One for X11
(vo&common) and one for Xv  & XvMC, I'll split the commit message too.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bgrd2.patch
Type: application/octet-stream
Size: 3267 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110527/c364f7aa/attachment.obj>


More information about the MPlayer-dev-eng mailing list