summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-01 19:55:43 +0200
committerwm4 <wm4@nowhere>2015-05-01 21:51:09 +0200
commit60958ddf9b1db1101f81c3db59b8e8c980af7cf2 (patch)
tree56051b0c8dbf044542ffe51f208c99bbce4de0f3 /player
parent94a3a76ee31bdc00255dc231e99be9f9ad6f38fa (diff)
downloadmpv-60958ddf9b1db1101f81c3db59b8e8c980af7cf2.tar.bz2
mpv-60958ddf9b1db1101f81c3db59b8e8c980af7cf2.tar.xz
screenshots: add --screenshot-directory option
The plan is to use this to change the screenshot default location in pseudo-gui mode.
Diffstat (limited to 'player')
-rw-r--r--player/screenshot.c8
1 files changed, 8 insertions, 0 deletions
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;