summaryrefslogtreecommitdiffstats
path: root/options
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-06-19 19:40:20 -0500
committerDudemanguy <random342@airmail.cc>2022-06-22 03:55:49 +0000
commit24f4582b6f7f57f566418551f9252b8578d2b602 (patch)
tree17888dcd02b9799903131f51ad67efe2c124c0e5 /options
parentd9f7dd7212b6306350c8b4c6e0b1959f384fb272 (diff)
downloadmpv-24f4582b6f7f57f566418551f9252b8578d2b602.tar.bz2
mpv-24f4582b6f7f57f566418551f9252b8578d2b602.tar.xz
x11: add --x11-present option
With the recent addition of the libxpresent, it should improve frame timings for most users. However, there were known cases of bad behavior (Nvidia) which lead to a construction of a whitelist instead of just enabling this all the time. Since there's no way to predict whatever combination of hardware/drivers/etc. may work correctly, just give users an option to switch the usage of xorg's presentation statistics on/off. The default value, auto, works like before (basically, Mesa drivers and no Nvidia are allowed), but now one can force it on/off if needed.
Diffstat (limited to 'options')
-rw-r--r--options/options.c3
-rw-r--r--options/options.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/options/options.c b/options/options.c
index 6d38af53b4..0b1c58d9a6 100644
--- a/options/options.c
+++ b/options/options.c
@@ -175,6 +175,8 @@ static const m_option_t mp_vo_opt_list[] = {
{"x11-netwm", OPT_CHOICE(x11_netwm, {"auto", 0}, {"no", -1}, {"yes", 1})},
{"x11-bypass-compositor", OPT_CHOICE(x11_bypass_compositor,
{"no", 0}, {"yes", 1}, {"fs-only", 2}, {"never", 3})},
+ {"x11-present", OPT_CHOICE(x11_present,
+ {"no", 0}, {"auto", 1}, {"yes", 2})},
#endif
#if HAVE_WIN32_DESKTOP
{"vo-mmcss-profile", OPT_STRING(mmcss_profile)},
@@ -212,6 +214,7 @@ const struct m_sub_options vo_sub_opts = {
.WinID = -1,
.window_scale = 1.0,
.x11_bypass_compositor = 2,
+ .x11_present = 1,
.mmcss_profile = "Playback",
.ontop_level = -1,
.timing_offset = 0.050,
diff --git a/options/options.h b/options/options.h
index 4eb5ef07c7..f38f3b6bfb 100644
--- a/options/options.h
+++ b/options/options.h
@@ -29,6 +29,7 @@ typedef struct mp_vo_opts {
char *appid;
int x11_netwm;
int x11_bypass_compositor;
+ int x11_present;
int native_keyrepeat;
float panscan;