From 60958ddf9b1db1101f81c3db59b8e8c980af7cf2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 1 May 2015 19:55:43 +0200 Subject: screenshots: add --screenshot-directory option The plan is to use this to change the screenshot default location in pseudo-gui mode. --- player/screenshot.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'player/screenshot.c') diff --git a/player/screenshot.c b/player/screenshot.c index a47de292d5..1db1d95996 100644 --- a/player/screenshot.c +++ b/player/screenshot.c @@ -280,6 +280,14 @@ static char *gen_fname(screenshot_ctx *ctx, const char *file_ext) return NULL; } + char *dir = ctx->mpctx->opts->screenshot_direcrory; + if (dir && dir[0]) { + void *t = fname; + dir = mp_get_user_path(t, ctx->mpctx->global, dir); + fname = mp_path_join(NULL, bstr0(dir), bstr0(fname)); + talloc_free(t); + } + if (!mp_path_exists(fname)) return fname; -- cgit v1.2.3