screenshots: create screenshot dir

Minor user convenience.
This commit is contained in:
wm4 2015-05-02 16:38:38 +02:00
parent f509a2badb
commit 15d8cf7fa2
2 changed files with 5 additions and 2 deletions

View File

@ -2661,8 +2661,9 @@ Screenshot
generated by ``--screenshot-template``. If the template filename is already
absolute, the directory is ignored.
If the directory does not exist or is not a directory, an error is
generated.
If the directory does not exist, it is created on the first screenshot. If
it is not a directory, an error is generated when trying to write a
screenshot.
This option is not set by default, and thus will write screenshots to the
directory from which mpv was started. In pseudo-gui mode

View File

@ -286,6 +286,8 @@ static char *gen_fname(screenshot_ctx *ctx, const char *file_ext)
dir = mp_get_user_path(t, ctx->mpctx->global, dir);
fname = mp_path_join(NULL, bstr0(dir), bstr0(fname));
talloc_free(t);
mp_mkdirp(dir);
}
if (!mp_path_exists(fname))