diff options
author | wm4 <wm4@nowhere> | 2012-08-06 17:48:30 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-08-06 17:48:30 +0200 |
commit | 5f57d276562c18ce65c47fa60f442ea427d7033e (patch) | |
tree | 95e7820e8ed3be3a3d809feb22dd236c7f1af0fc /screenshot.c | |
parent | 4de99d9c0c1451db8a11c4f8173352e932844f14 (diff) | |
download | mpv-5f57d276562c18ce65c47fa60f442ea427d7033e.tar.bz2 mpv-5f57d276562c18ce65c47fa60f442ea427d7033e.tar.xz |
image_writer: add option parsing
image_writer now provides its own option parsing, and screenshot.c and
the mplayer frontend use it.
Diffstat (limited to 'screenshot.c')
-rw-r--r-- | screenshot.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/screenshot.c b/screenshot.c index 6c734f57b5..032fa132f4 100644 --- a/screenshot.c +++ b/screenshot.c @@ -262,15 +262,12 @@ void screenshot_save(struct MPContext *mpctx, struct mp_image *image) struct mp_csp_details colorspace; get_detected_video_colorspace(mpctx->sh_video, &colorspace); - struct image_writer_opts opts = image_writer_opts_defaults; - opts.filetype = mpctx->opts.screenshot_filetype; - opts.jpeg_quality = mpctx->opts.screenshot_jpeg_quality; - opts.png_compression = mpctx->opts.screenshot_png_compression; + struct image_writer_opts *opts = mpctx->opts.screenshot_image_opts; - char *filename = gen_fname(ctx, image_writer_file_ext(&opts)); + char *filename = gen_fname(ctx, image_writer_file_ext(opts)); if (filename) { mp_msg(MSGT_CPLAYER, MSGL_INFO, "*** screenshot '%s' ***\n", filename); - if (!write_image(image, &colorspace, &opts, filename)) + if (!write_image(image, &colorspace, opts, filename)) mp_msg(MSGT_CPLAYER, MSGL_ERR, "\nError writing screenshot!\n"); talloc_free(filename); } |