diff options
author | wm4 <wm4@nowhere> | 2014-10-23 10:51:51 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-10-23 10:51:51 +0200 |
commit | 34373032b516e54843f673377bf89f506a303092 (patch) | |
tree | 39465303908819eb3aa5bea07e6a74327c0ac73a | |
parent | 474461244e354c6f84b836aeb94dfaa44de0eed8 (diff) |
win32: change config path priorities
Assume mpv.exe is located in $mpv_exe_dir, then config files were
preferably loaded from "$mpv_exe_dir/mpv". This was mostly traditional,
and inherited from MPlayer times.
Reverse the config path priority order, and prefer $CSIDL_APPDATA/mpv as
main config path. This also fixes behavior when writing watch_later
configs, and mpv is installed in a not-writable path.
It's possible that this will cause regressions for some users, if the
change in preference suddenly prefers stale config files (which may
happen to longer around in the appdata config dir) over the user's
proper config.
Also explicitly document the behavior.
-rw-r--r-- | DOCS/man/mpv.rst | 29 | ||||
-rw-r--r-- | osdep/path-win.c | 4 |
2 files changed, 31 insertions, 2 deletions
diff --git a/DOCS/man/mpv.rst b/DOCS/man/mpv.rst index 09629a810f..82cce2e72d 100644 --- a/DOCS/man/mpv.rst +++ b/DOCS/man/mpv.rst @@ -717,6 +717,35 @@ override the standard directory ``~/.config/mpv/``. Also, the old config location at ``~/.mpv/`` is still read, and if the XDG variant does not exist, will still be preferred. +FILES ON WINDOWS +================ + +On win32 (if compiled with MinGW, but not Cygwin), the default config file +locations are different: + +``$CSIDL_APPDATA/mpv/mpv.conf`` + Preferred mpv config file. This maps to a system and user-specific path, + for example ``C:\users\USERNAME\Application Data\mpv\mpv.conf``. + +``$CSIDL_APPDATA/mpv/input.conf`` + key bindings (see `INPUT.CONF`_ section) + +``$CSIDL_APPDATA/mpv/lua/`` + equivalent of ``~/.config/mpv/lua/`` on Unix. + +The environment variable ``$MPV_HOME`` completely overrides these, like on +UNIX. + +Config files located in the same directory as ``mpv.exe`` are loaded with +lower priority. Some config files are loaded only once, which means that +e.g. of 2 ``input.conf`` files located in two config directories, only the +one from the directory with higher priority will be loaded. + +A third config directory with lowest priority is the directory named ``mpv`` +in the same directory as ``mpv.exe``. This used to be the directory with +highest priority, but is now discouraged to use and might be removed in the +future. + EXAMPLES OF MPV USAGE ===================== diff --git a/osdep/path-win.c b/osdep/path-win.c index c6560233f5..66d8de96e4 100644 --- a/osdep/path-win.c +++ b/osdep/path-win.c @@ -61,11 +61,11 @@ static char *mp_get_win_app_dir(void *talloc_ctx) int mp_add_win_config_dirs(struct mpv_global *global, char **dirs, int i) { void *talloc_ctx = dirs; - if ((dirs[i] = mp_get_win_exe_subdir(talloc_ctx))) + if ((dirs[i] = mp_get_win_app_dir(talloc_ctx))) i++; if ((dirs[i] = mp_get_win_exe_dir(talloc_ctx))) i++; - if ((dirs[i] = mp_get_win_app_dir(talloc_ctx))) + if ((dirs[i] = mp_get_win_exe_subdir(talloc_ctx))) i++; return i; } |