mirror of
https://github.com/mpv-player/mpv
synced 2025-04-26 13:19:12 +00:00
screenshot: avoid confusing template error message with no file
Previously, with mpv --force-window=yes --idle=yes --screenshot-template="%f", mpv would display an error saying that the template was incorrect, which it isn't, there's just no file to put in the format. In this case, just use the string "NO_FILE".
This commit is contained in:
parent
eabc530945
commit
a8e6de90fe
@ -165,15 +165,17 @@ static char *create_fname(struct MPContext *mpctx, char *template,
|
||||
}
|
||||
case 'f':
|
||||
case 'F': {
|
||||
if (!mpctx->filename)
|
||||
goto error_exit;
|
||||
char *video_file = mp_basename(mpctx->filename);
|
||||
if (video_file) {
|
||||
char *video_file = NULL;
|
||||
if (mpctx->filename)
|
||||
video_file = mp_basename(mpctx->filename);
|
||||
|
||||
if (!video_file)
|
||||
video_file = "NO_FILE";
|
||||
|
||||
char *name = video_file;
|
||||
if (fmt == 'F')
|
||||
name = stripext(res, video_file);
|
||||
append_filename(&res, name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'x':
|
||||
|
Loading…
Reference in New Issue
Block a user