From 5f57d276562c18ce65c47fa60f442ea427d7033e Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 6 Aug 2012 17:48:30 +0200 Subject: image_writer: add option parsing image_writer now provides its own option parsing, and screenshot.c and the mplayer frontend use it. --- screenshot.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'screenshot.c') 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); } -- cgit v1.2.3