diff options
author | Dudemanguy <random342@airmail.cc> | 2022-06-21 23:13:44 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2022-06-22 18:09:11 +0000 |
commit | 652f09a7a6665be2a04ff8ec4f741de435bd536f (patch) | |
tree | 64259646673fb739e96e267d28b74f8a4b0e1b96 /video/out/vo_xv.c | |
parent | 1ffdb9128d87dffe869c1e9f4024a16bfd0022c4 (diff) | |
download | mpv-652f09a7a6665be2a04ff8ec4f741de435bd536f.tar.bz2 mpv-652f09a7a6665be2a04ff8ec4f741de435bd536f.tar.xz |
x11: avoid XPresent API calls when it's not needed
This commit kind of mixes several related things together. The main
thing is to avoid calling any XPresent functions or internal functions
related to presentation when the feature is not auto-whitelisted or
enabled by the user. Internally rework this so it all works off of a
use_present bool (have_present is eliminated because having a non-zero
present_code covers exactly the same thing) and make sure it updates on
runtime. Finally, put some actual logging in here whenever XPresent is
enabled/disabled. Fixes #10326.
Diffstat (limited to 'video/out/vo_xv.c')
-rw-r--r-- | video/out/vo_xv.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c index 8fe98839ca..d3257730d7 100644 --- a/video/out/vo_xv.c +++ b/video/out/vo_xv.c @@ -691,14 +691,17 @@ static void flip_page(struct vo *vo) if (!ctx->Shmem_Flag) XSync(vo->x11->display, False); - vo_x11_present(vo); - present_sync_swap(vo->x11->present); + if (vo->x11->use_present) { + vo_x11_present(vo); + present_sync_swap(vo->x11->present); + } } static void get_vsync(struct vo *vo, struct vo_vsync_info *info) { struct vo_x11_state *x11 = vo->x11; - present_sync_get_info(x11->present, info); + if (x11->use_present) + present_sync_get_info(x11->present, info); } // Note: REDRAW_FRAME can call this with NULL. |