summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-06-25 17:55:50 +0200
committerwm4 <wm4@nowhere>2020-06-25 17:56:16 +0200
commit22a27c6720244dd24c9b704c8a8225ca1665272f (patch)
tree076ca3ce26eee2ec917b9f189144201bf8f176d2 /player
parentc3694f0acb7f71daac7606fafbadcb7b500ca35e (diff)
downloadmpv-22a27c6720244dd24c9b704c8a8225ca1665272f.tar.bz2
mpv-22a27c6720244dd24c9b704c8a8225ca1665272f.tar.xz
player: warn if both proper and compat. config directories exist
No idea why there's logic to add them all to the search path, so "both" are used. In any case, this isn't something anyone should use.
Diffstat (limited to 'player')
-rw-r--r--player/configfiles.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/player/configfiles.c b/player/configfiles.c
index 89b412e576..0150133dbd 100644
--- a/player/configfiles.c
+++ b/player/configfiles.c
@@ -65,7 +65,16 @@ void mp_parse_cfgfiles(struct MPContext *mpctx)
mp_mk_config_dir(mpctx->global, "");
- m_config_t *conf = mpctx->mconfig;
+ char *p1 = mp_get_user_path(NULL, mpctx->global, "~~home/");
+ char *p2 = mp_get_user_path(NULL, mpctx->global, "~~old_home/");
+ if (strcmp(p1, p2) != 0 && mp_path_exists(p2)) {
+ MP_WARN(mpctx, "Warning, two config dirs found:\n %s (main)\n"
+ " %s (bogus)\nYou should merge or delete the second one.\n",
+ p1, p2);
+ }
+ talloc_free(p1);
+ talloc_free(p2);
+
char *section = NULL;
bool encoding = opts->encode_opts &&
opts->encode_opts->file && opts->encode_opts->file[0];
@@ -81,7 +90,7 @@ void mp_parse_cfgfiles(struct MPContext *mpctx)
load_all_cfgfiles(mpctx, section, "mpv.conf|config");
if (encoding)
- m_config_set_profile(conf, SECT_ENCODE, 0);
+ m_config_set_profile(mpctx->mconfig, SECT_ENCODE, 0);
}
static int try_load_config(struct MPContext *mpctx, const char *file, int flags,