path: root/input
diff options
authorwm4 <wm4@nowhere>2013-12-21 20:45:19 +0100
committerwm4 <wm4@nowhere>2013-12-21 21:43:17 +0100
commitad2199128da4a689be374e92aab57ac2c9fa76b9 (patch)
treee59647846141017a5ef1da3a3b0961b95cfbc5e6 /input
parent232b8de095b0ad493f7aa83e900e861bcb11f52a (diff)
path lookup functions: mp_msg conversions
There's a single mp_msg() in path.c, but all path lookup functions seem to depend on it, so we get a rat-tail of stuff we have to change. This is probably a good thing though, because we can have the path lookup functions also access options, so we could allow overriding the default config path, or ignore the MPV_HOME environment variable, and such things. Also take the chance to consistently add talloc_ctx parameters to the path lookup functions. Also, this change causes a big mess on configfiles.c. It's the same issue: everything suddenly needs a (different) context argument. Make it less wild by providing a mp_load_auto_profiles() function, which isolates most of it to configfiles.c.
Diffstat (limited to 'input')
1 files changed, 2 insertions, 2 deletions
diff --git a/input/input.c b/input/input.c
index 8756985793..fc3e282287 100644
--- a/input/input.c
+++ b/input/input.c
@@ -2202,7 +2202,7 @@ static int parse_config_file(struct input_ctx *ictx, char *file, bool warn)
void *tmp = talloc_new(NULL);
stream_t *s = NULL;
- file = mp_get_user_path(tmp, file);
+ file = mp_get_user_path(tmp, ictx->global, file);
if (!mp_path_exists(file)) {
MP_MSG(ictx, warn ? MSGL_ERR : MSGL_V,
"Input config file %s not found.\n", file);
@@ -2418,7 +2418,7 @@ struct input_ctx *mp_input_init(struct mpv_global *global)
config_ok = parse_config_file(ictx, input_conf->config_file, true);
if (!config_ok && global->opts->load_config) {
// Try global conf dir
- char *file = mp_find_config_file("input.conf");
+ char *file = mp_find_config_file(NULL, global, "input.conf");
config_ok = file && parse_config_file(ictx, file, false);