mirror of
https://github.com/mpv-player/mpv
synced 2024-12-26 17:12:36 +00:00
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.
This commit is contained in:
parent
c345680e8c
commit
8de7ba6dfd
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user