summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorrr- <rr-@sakuya.pl>2017-03-23 22:17:59 +0100
committerwm4 <wm4@nowhere>2017-03-24 14:09:02 +0100
commit8de7ba6dfd87b1c62b0d057f1ed547360aff3eb1 (patch)
tree8c13e424254e6b2b9d9fb83ff6e124a98a3642c2 /video
parentc345680e8cdc3b7f5ceeb80bf2ad95374a5cb33c (diff)
downloadmpv-8de7ba6dfd87b1c62b0d057f1ed547360aff3eb1.tar.bz2
mpv-8de7ba6dfd87b1c62b0d057f1ed547360aff3eb1.tar.xz
vo_x11: reduce flickering on playlist navigation
The delay between call to .resize, which cleared the buffer, and actually rendering the first video frame, was significant, resulting in short flicker on navigation and resizing. This was especially visible when zooming and navigating between images. Now the clearing is scheduled to happen just before the rendering, which looks to be good enough even without double buffering.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo_x11.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/video/out/vo_x11.c b/video/out/vo_x11.c
index 9540fd96b6..db967577a3 100644
--- a/video/out/vo_x11.c
+++ b/video/out/vo_x11.c
@@ -77,6 +77,7 @@ struct priv {
XVisualInfo vinfo;
int current_buf;
+ bool reset_view;
#if HAVE_SHM && HAVE_XEXT
int Shmem_Flag;
@@ -268,8 +269,7 @@ static bool resize(struct vo *vo)
if (mp_sws_reinit(p->sws) < 0)
return false;
- XFillRectangle(x11->display, x11->window, p->gc, 0, 0, vo->dwidth, vo->dheight);
-
+ p->reset_view = true;
vo->want_redraw = true;
return true;
}
@@ -280,6 +280,11 @@ static void Display_Image(struct priv *p, XImage *myximage)
XImage *x_image = p->myximage[p->current_buf];
+ if (p->reset_view) {
+ XFillRectangle(vo->x11->display, vo->x11->window, p->gc, 0, 0, vo->dwidth, vo->dheight);
+ p->reset_view = false;
+ }
+
#if HAVE_SHM && HAVE_XEXT
if (p->Shmem_Flag) {
XShmPutImage(vo->x11->display, vo->x11->window, p->gc, x_image,