1
mirror of https://github.com/mpv-player/mpv synced 2024-08-04 14:59:58 +02:00

screenshot: improve error messages

Include filename in the error message, if the screenshot destination
file already exists.

Consistently quote filenames with 'quotes' in messages.
This commit is contained in:
wm4 2012-04-29 19:54:01 +02:00
parent 4add4f708e
commit 5fe14d5bf1

View File

@ -400,13 +400,13 @@ static char *gen_fname(screenshot_ctx *ctx)
if (!fexists(fname))
return fname;
talloc_free(fname);
if (sequence == prev_sequence) {
mp_msg(MSGT_CPLAYER, MSGL_ERR, "Can't save screenshot, file "
"already exists!\n");
mp_msg(MSGT_CPLAYER, MSGL_ERR, "Can't save screenshot, file '%s' "
"already exists!\n", fname);
return NULL;
}
talloc_free(fname);
}
}
@ -447,8 +447,8 @@ void screenshot_save(struct MPContext *mpctx, struct mp_image *image)
if (filename) {
FILE *fp = fopen(filename, "wb");
if (fp == NULL) {
mp_msg(MSGT_CPLAYER, MSGL_ERR, "\nError opening %s for writing!\n",
filename);
mp_msg(MSGT_CPLAYER, MSGL_ERR,
"\nError opening '%s' for writing!\n", filename);
} else {
mp_msg(MSGT_CPLAYER, MSGL_INFO, "*** screenshot '%s' ***\n",
filename);