summaryrefslogtreecommitdiffstats
path: root/screenshot.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-10-26 19:29:47 +0200
committerwm4 <wm4@nowhere>2012-11-01 02:07:45 +0100
commit738aeb1c60c6ffe95e915e443598f8a51081bdfb (patch)
treec10472cd8e646344d0d5e2bf1644adcb002c424a /screenshot.c
parent9ba52ea6efd41db9dbd08311380f7fa633e22aa2 (diff)
downloadmpv-738aeb1c60c6ffe95e915e443598f8a51081bdfb.tar.bz2
mpv-738aeb1c60c6ffe95e915e443598f8a51081bdfb.tar.xz
screenshot: let VOs pass colorspace information via mp_image
This removes the hack that screenshot_save() got the colorspace information from the decoder. Instead, require the VOs to set the colorspace information on the mp_images used to pass around the screenshot data. This is more correct, as the image may have been converted/modified in the video filter chain, although there's nothing yet in the video filter chain which does this correctly.
Diffstat (limited to 'screenshot.c')
-rw-r--r--screenshot.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/screenshot.c b/screenshot.c
index e34fd6da15..f69bba9b76 100644
--- a/screenshot.c
+++ b/screenshot.c
@@ -270,14 +270,6 @@ static void screenshot_save(struct MPContext *mpctx, struct mp_image *image,
{
screenshot_ctx *ctx = mpctx->screenshot_ctx;
- struct mp_csp_details colorspace;
- get_detected_video_colorspace(mpctx->sh_video, &colorspace);
- // This is a property of the output device; images always use
- // full-range RGB.
- colorspace.levels_out = MP_CSP_LEVELS_PC;
- // This is a bad hack, until the VOs set image->colorspace correctly
- mp_image_set_colorspace_details(image, &colorspace);
-
struct image_writer_opts *opts = mpctx->opts.screenshot_image_opts;
struct mp_image *new_image = image;
@@ -287,7 +279,7 @@ static void screenshot_save(struct MPContext *mpctx, struct mp_image *image,
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(new_image, &colorspace, opts, filename))
+ if (!write_image(new_image, opts, filename))
mp_msg(MSGT_CPLAYER, MSGL_ERR, "\nError writing screenshot!\n");
talloc_free(filename);
}