From ad2199128da4a689be374e92aab57ac2c9fa76b9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 21 Dec 2013 20:45:19 +0100 Subject: 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. --- osdep/path-macosx.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'osdep/path-macosx.m') diff --git a/osdep/path-macosx.m b/osdep/path-macosx.m index d4c5020da1..543b248c14 100644 --- a/osdep/path-macosx.m +++ b/osdep/path-macosx.m @@ -20,11 +20,12 @@ #include "options/path.h" #include "osdep/path.h" -char *mp_get_macosx_bundled_path(const char *file) +char *mp_get_macosx_bundled_path(void *talloc_ctx, struct mpv_global *global, + const char *filename) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSString *path = [[NSBundle mainBundle] resourcePath]; - char *rv = mp_path_join(NULL, bstr0([path UTF8String]), bstr0(file)); + char *rv = mp_path_join(talloc_ctx, bstr0([path UTF8String]), bstr0(file)); [pool release]; return rv; } -- cgit v1.2.3