summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/video.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-05-02 19:42:23 -0500
committerDudemanguy <random342@airmail.cc>2023-05-09 20:37:17 +0000
commit4502522a7aee093c923e79a65e4684ea2634af30 (patch)
treed7855be2c4cfb6a16edc784da0e6f3dad29ee667 /video/out/gpu/video.c
parent7c4c9bc86f55f4d1224814fbeafdee8f1c3c3108 (diff)
downloadmpv-4502522a7aee093c923e79a65e4684ea2634af30.tar.bz2
mpv-4502522a7aee093c923e79a65e4684ea2634af30.tar.xz
player: use XDG_CACHE_HOME by default
This adds cache as a possible path for mpv to internally pick (~/.cache/mpv for non-darwin unix-like systems, the usual config directory for everyone else). For gpu shader cache and icc cache, controlling whether or not to write such files is done with the new --gpu-shader-cache and --icc-cache options respectively. Additionally, --cache-on-disk no longer requires explicitly setting the --cache-dir option. The old options, --cache-dir, --gpu-shader-cache-dir, and --icc-cache-dir simply set an override for the directory to save cache files. If unset, then the cache is saved in XDG_CACHE_HOME.
Diffstat (limited to 'video/out/gpu/video.c')
-rw-r--r--video/out/gpu/video.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c
index cfd864680b..2d16d8435e 100644
--- a/video/out/gpu/video.c
+++ b/video/out/gpu/video.c
@@ -465,6 +465,7 @@ const struct m_sub_options gl_video_conf = {
{"gpu-tex-pad-x", OPT_INT(tex_pad_x), M_RANGE(0, 4096)},
{"gpu-tex-pad-y", OPT_INT(tex_pad_y), M_RANGE(0, 4096)},
{"", OPT_SUBSTRUCT(icc_opts, mp_icc_conf)},
+ {"gpu-shader-cache", OPT_BOOL(shader_cache)},
{"gpu-shader-cache-dir", OPT_STRING(shader_cache_dir), .flags = M_OPT_FILE},
{"gpu-hwdec-interop",
OPT_STRING_VALIDATE(hwdec_interop, ra_hwdec_validate_opt)},
@@ -4099,7 +4100,8 @@ static void reinit_from_options(struct gl_video *p)
check_gl_features(p);
uninit_rendering(p);
- gl_sc_set_cache_dir(p->sc, p->opts.shader_cache_dir);
+ if (p->opts.shader_cache)
+ gl_sc_set_cache_dir(p->sc, p->opts.shader_cache_dir);
p->ra->use_pbo = p->opts.pbo;
gl_video_setup_hooks(p);
reinit_osd(p);