summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2023-10-02 13:14:52 +0200
committersfan5 <sfan5@live.de>2023-10-02 18:48:10 +0200
commitdf758880e26ccdb084e2ad9dd33d8c1835ac4a3f (patch)
tree48f2562087dfcbb898d6809ae3b5fc642caea2e8
parent0a1e3d86852bc6267a622b9ec442c4a3ea9d66d9 (diff)
downloadmpv-df758880e26ccdb084e2ad9dd33d8c1835ac4a3f.tar.bz2
mpv-df758880e26ccdb084e2ad9dd33d8c1835ac4a3f.tar.xz
path: don't override "cache" and "state" paths with configdir
This reverts commit 576e86bfa18a0a79e591988ad93ed009edc40849 (functionally). Right now, the --config-dir option silently causes all watch_later and cache files to be written in the --config-dir as well. This is pretty uninitutive and also not desirable in most cases so get rid of this. libmpv users will have to set the corresponding options or env vars if they want to keep the old behaviour.
-rw-r--r--DOCS/interface-changes.rst1
-rw-r--r--DOCS/man/options.rst3
-rw-r--r--options/path.c10
3 files changed, 4 insertions, 10 deletions
diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst
index 304d610108..9c7d69487a 100644
--- a/DOCS/interface-changes.rst
+++ b/DOCS/interface-changes.rst
@@ -95,6 +95,7 @@ Interface changes
- deprecate shared-script-properties (user-data is a replacement)
- add `--backdrop-type` option
- add `--window-affinity` option
+ - `--config-dir` no longer forces cache and state files to also reside in there
--- mpv 0.36.0 ---
- add `--target-contrast`
- Target luminance value is now also applied when ICC profile is used.
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index bc7425d9ea..a9c8687e4f 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -763,6 +763,9 @@ Program Behavior
as well as per-user directories are ignored, and overrides through
environment variables (``MPV_HOME``) are also ignored.
+ Note that the cache and state paths (``~~/cache``, ``~~/state``) are not
+ considered "configuration" and keep their auto-detection logic.
+
Note that the ``--no-config`` option takes precedence over this option.
``--dump-stats=<filename>``
diff --git a/options/path.c b/options/path.c
index c4fdc863a0..581874b94b 100644
--- a/options/path.c
+++ b/options/path.c
@@ -64,12 +64,6 @@ static const char *const config_dirs[] = {
"exe_dir",
"global",
};
-// types that configdir replaces (if set)
-// These are not part of any fallback order so need to be overriden separately.
-static const char *const config_dir_replaces[] = {
- "state",
- "cache",
-};
// Return a platform specific path using a path type as defined in osdep/path.h.
// Keep in mind that the only way to free the return value is freeing talloc_ctx
@@ -86,10 +80,6 @@ static const char *mp_get_platform_path(void *talloc_ctx,
if (strcmp(config_dirs[n], type) == 0)
return (n == 0 && global->configdir[0]) ? global->configdir : NULL;
}
- for (int n = 0; n < MP_ARRAY_SIZE(config_dir_replaces); n++) {
- if (strcmp(config_dir_replaces[n], type) == 0)
- return global->configdir[0] ? global->configdir : NULL;
- }
}
// Return the native config path if the platform doesn't support the