mirror of
https://github.com/mpv-player/mpv
synced 2025-03-03 04:37:54 +00: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:
parent
f099f504af
commit
49e925f830
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user