mirror of https://github.com/mpv-player/mpv
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: cbbe2e5221
This commit is contained in:
parent
157ef77427
commit
a960b75604
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue