diff options
author | sfan5 <sfan5@live.de> | 2023-07-17 23:16:46 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-07-19 13:01:08 +0200 |
commit | a960b756045f37eccec43bfb06e9e51c4f245f55 (patch) | |
tree | 885c16c5b8426c8ae1fec2418fb71813535e3d29 | |
parent | 157ef7742721bdf6a69b0f20649a32f0d590edc3 (diff) | |
download | mpv-a960b756045f37eccec43bfb06e9e51c4f245f55.tar.bz2 mpv-a960b756045f37eccec43bfb06e9e51c4f245f55.tar.xz |
image_writer: move tag_csp check into image_writer_flexible_csp()
This ensures the sRGB fallback to happen in all situations involving
the image writer code, notably --screenshot-sw.
fixes: cbbe2e52210d9885a0897e9c7833267a60456c56
-rw-r--r-- | DOCS/man/options.rst | 8 | ||||
-rw-r--r-- | player/screenshot.c | 2 | ||||
-rw-r--r-- | video/image_writer.c | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index a40d6befb0..fab91dd3d2 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -4334,11 +4334,11 @@ Screenshot :avif: AVIF ``--screenshot-tag-colorspace=<yes|no>`` - Tag screenshots with the appropriate colorspace. + Tag screenshots with the appropriate colorspace (default: yes). - Note that not all formats are supported. - - Default: ``yes``. + Note that not all formats support this. When it is unsupported, or when + this option is disabled, screenshots will be converted to sRGB before + being written. ``--screenshot-high-bit-depth=<yes|no>`` If possible, write screenshots with a bit depth similar to the source diff --git a/player/screenshot.c b/player/screenshot.c index 1feeba2133..30810e3d6f 100644 --- a/player/screenshot.c +++ b/player/screenshot.c @@ -350,7 +350,7 @@ static struct mp_image *screenshot_get(struct MPContext *mpctx, int mode, .subs = mode != 0, .osd = mode == MODE_FULL_WINDOW, .high_bit_depth = high_depth && imgopts->high_bit_depth, - .native_csp = imgopts->tag_csp && image_writer_flexible_csp(imgopts), + .native_csp = image_writer_flexible_csp(imgopts), }; if (!mpctx->opts->screenshot_sw) vo_control(mpctx->video_out, VOCTRL_SCREENSHOT, &ctrl); diff --git a/video/image_writer.c b/video/image_writer.c index 6edd79ae31..9d3087c461 100644 --- a/video/image_writer.c +++ b/video/image_writer.c @@ -587,6 +587,8 @@ bool image_writer_high_depth(const struct image_writer_opts *opts) bool image_writer_flexible_csp(const struct image_writer_opts *opts) { + if (!opts->tag_csp) + return false; return false #if HAVE_JPEGXL || opts->format == AV_CODEC_ID_JPEGXL |