0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-19 19:42:24 +02:00

screenshot: create directories from template

screenshot-template could be set to e.g. "%F/%04n", so we want to
make sure that the path generated from the template actually exists.
This commit is contained in:
Nicolas F 2017-10-31 00:28:27 +01:00 committed by wm4
parent f099f504af
commit 49e925f830

View File

@ -364,6 +364,11 @@ static char *gen_fname(screenshot_ctx *ctx, const char *file_ext)
talloc_free(t);
}
char *full_dir = bstrto0(fname, mp_dirname(fname));
if (!mp_path_exists(full_dir)) {
mp_mkdirp(full_dir);
}
if (!mp_path_exists(fname))
return fname;