vf_expand: always clear the added borders
commit827faa38436f55fbb15b7dce4abcc5c6608a428b
authorwm4 <wm4@mplayer2.org>
Sat, 17 Dec 2011 06:48:36 +0000 (17 07:48 +0100)
committerUoti Urpala <uau@mplayer2.org>
Mon, 19 Dec 2011 19:56:00 +0000 (19 21:56 +0200)
treeab9f08a21cbeedf71c52c2618374d831790dea20
parent4478acd618e0500a6a81ab893a23280824420a57
vf_expand: always clear the added borders

Using the "expand" filter makes the image area larger by adding
borders to the video frame. These borders are supposed to be always
black. The filter relied on the borders in its output buffer staying
black without redrawing them for each frame. However, when using
direct rendering, a video filter inserted after vf_expand can draw
into these borders, for example the "unsharp" and "ass" filters. These
changes incorrectly stayed visible in the the following video frames.

Fix this by always clearing the borders in vf_expand. In some cases,
this might be more work than necessary, but vf_expand has no way of
detecting whether a subsequent filter draws into the borders or not,
and this avoids fragile assumptions about the existing contents of the
output buffer(s).

This also deals with frame size changes when config() is called again.
Before this commit, remains of the old video were visible if the new
video frame size was smaller than before.

Since we now always clear the borders, there's no more need for the
complicated code that cleared only the regions that were covered by the
OSD. Delete that.
libmpcodecs/vf_expand.c