diff options
author | wm4 <wm4@nowhere> | 2013-12-14 19:50:00 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-12-14 19:54:49 +0100 |
commit | 683d7e88e46463497033eb4759ced45ee8b8cc49 (patch) | |
tree | aa99cebe436f180c2d3c2e070ec4d3896386153a /mpvcore/player | |
parent | dcf9f77c58691bde3e4e0ac60e5a5d7e1fc95b42 (diff) | |
download | mpv-683d7e88e46463497033eb4759ced45ee8b8cc49.tar.bz2 mpv-683d7e88e46463497033eb4759ced45ee8b8cc49.tar.xz |
Allow some options taking filenames to refer to mpv config dir
Add the mp_get_user_path() function, and make it expand special path
prefixes. Use it for some things in mpv which take filenames
(--input-config, --screenshot-template, opengl icc-profile suboption).
This allows accessing files in the mpv config dir without hardcoding the
config path by prefixing the path with ~~/. Details see manpage
additions.
Diffstat (limited to 'mpvcore/player')
-rw-r--r-- | mpvcore/player/screenshot.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mpvcore/player/screenshot.c b/mpvcore/player/screenshot.c index bf7a0ce9ee..d719495f9e 100644 --- a/mpvcore/player/screenshot.c +++ b/mpvcore/player/screenshot.c @@ -233,7 +233,10 @@ static char *create_fname(struct MPContext *mpctx, char *template, } res = talloc_strdup_append(res, template); - return talloc_asprintf_append(res, ".%s", file_ext); + res = talloc_asprintf_append(res, ".%s", file_ext); + char *fname = mp_get_user_path(NULL, res); + talloc_free(res); + return fname; error_exit: talloc_free(res); |