diff options
author | wm4 <wm4@mplayer2.org> | 2012-04-29 19:54:01 +0200 |
---|---|---|
committer | wm4 <wm4@mplayer2.org> | 2012-04-29 20:31:42 +0200 |
commit | 5fe14d5bf11a22025914a1948770e0b720a8d46f (patch) | |
tree | dbbbc0a2d7616d47782499a9b664656328857e26 /screenshot.c | |
parent | 4add4f708e14367833fb9f1308c0802fbe32a808 (diff) | |
download | mpv-5fe14d5bf11a22025914a1948770e0b720a8d46f.tar.bz2 mpv-5fe14d5bf11a22025914a1948770e0b720a8d46f.tar.xz |
screenshot: improve error messages
Include filename in the error message, if the screenshot destination
file already exists.
Consistently quote filenames with 'quotes' in messages.
Diffstat (limited to 'screenshot.c')
-rw-r--r-- | screenshot.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/screenshot.c b/screenshot.c index 43e77f22a5..73aefc4361 100644 --- a/screenshot.c +++ b/screenshot.c @@ -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); |