mirror of
https://github.com/mpv-player/mpv
synced 2025-01-09 16:39:49 +00:00
screenshots: create screenshot dir
Minor user convenience.
This commit is contained in:
parent
f509a2badb
commit
15d8cf7fa2
@ -2661,8 +2661,9 @@ Screenshot
|
|||||||
generated by ``--screenshot-template``. If the template filename is already
|
generated by ``--screenshot-template``. If the template filename is already
|
||||||
absolute, the directory is ignored.
|
absolute, the directory is ignored.
|
||||||
|
|
||||||
If the directory does not exist or is not a directory, an error is
|
If the directory does not exist, it is created on the first screenshot. If
|
||||||
generated.
|
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
|
This option is not set by default, and thus will write screenshots to the
|
||||||
directory from which mpv was started. In pseudo-gui mode
|
directory from which mpv was started. In pseudo-gui mode
|
||||||
|
@ -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);
|
dir = mp_get_user_path(t, ctx->mpctx->global, dir);
|
||||||
fname = mp_path_join(NULL, bstr0(dir), bstr0(fname));
|
fname = mp_path_join(NULL, bstr0(dir), bstr0(fname));
|
||||||
talloc_free(t);
|
talloc_free(t);
|
||||||
|
|
||||||
|
mp_mkdirp(dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mp_path_exists(fname))
|
if (!mp_path_exists(fname))
|
||||||
|
Loading…
Reference in New Issue
Block a user