summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-06-25 17:44:46 +0200
committerJan Ekström <jeebjp@gmail.com>2020-11-16 00:44:40 +0200
commit26fc70dbfdb11844497f34e2d96ecd6a011cd6bc (patch)
treee887e9b113456b429fc9f706f21391f31bfa8fe8
parent932c1ada0f9b0f7078c09ef0179119c838eef84a (diff)
downloadmpv-26fc70dbfdb11844497f34e2d96ecd6a011cd6bc.tar.bz2
mpv-26fc70dbfdb11844497f34e2d96ecd6a011cd6bc.tar.xz
path: do not use old_home for win32 exe dir
Apparently mpv supports loading config files from the same directory as the mpv.exe. This is a fallback of some sort. It used the old_home mechanism. I want to add a warning if old_home exists, but that would always show the warning on win32. Obviously we don't want that. Add a separate exe_dir entry to deal with that. Untested, but probably works. Mistakenly reverted as part of the default configuration directory location switch-back in aa18a8e1cde663caeabd93af7d57a745c1a76af6. Separation of the mpv executable directory from old_path is a good change now that we warn about the old_config directory also existing. Fixes #8232 Fixes #8244 Fixes #8262
-rw-r--r--DOCS/man/mpv.rst2
-rw-r--r--options/path.c1
-rw-r--r--osdep/path-win.c2
3 files changed, 4 insertions, 1 deletions
diff --git a/DOCS/man/mpv.rst b/DOCS/man/mpv.rst
index 46c0762fad..be29a977d5 100644
--- a/DOCS/man/mpv.rst
+++ b/DOCS/man/mpv.rst
@@ -441,6 +441,8 @@ Name Meaning
``~~global/`` the global config path, if available (not on win32)
``~~osxbundle/`` the OSX bundle resource path (OSX only)
``~~desktop/`` the path to the desktop (win32, OSX)
+``~~exe_dir`` win32 only: the path to the directory containing the exe (for
+ config file purposes; ``$MPV_HOME`` overrides it)
``~~old_home`` do not use
================ ===============================================================
diff --git a/options/path.c b/options/path.c
index 9c996ce664..504adb7c84 100644
--- a/options/path.c
+++ b/options/path.c
@@ -59,6 +59,7 @@ static const char *const config_dirs[] = {
"home",
"old_home",
"osxbundle",
+ "exe_dir",
"global",
};
diff --git a/osdep/path-win.c b/osdep/path-win.c
index 8f289ff83a..78e83c2222 100644
--- a/osdep/path-win.c
+++ b/osdep/path-win.c
@@ -90,7 +90,7 @@ const char *mp_get_platform_path_win(void *talloc_ctx, const char *type)
} else {
if (strcmp(type, "home") == 0)
return mp_get_win_app_dir(talloc_ctx);
- if (strcmp(type, "old_home") == 0)
+ if (strcmp(type, "exe_dir") == 0)
return mp_get_win_exe_dir(talloc_ctx);
// Not really true, but serves as a way to return a lowest-priority dir.
if (strcmp(type, "global") == 0)