diff options
author | llyyr <llyyr@yukari.in> | 2024-03-06 15:49:01 +0530 |
---|---|---|
committer | Kacper Michajłow <kasper93@gmail.com> | 2024-03-19 09:06:01 +0100 |
commit | f914947dda421aa5903084cf1813412c8bacb003 (patch) | |
tree | 461459a478189e342576707a7c94feb15b949350 /video/out | |
parent | 16ae76948d85e9f298f77fa7401189acff19c11f (diff) | |
download | mpv-f914947dda421aa5903084cf1813412c8bacb003.tar.bz2 mpv-f914947dda421aa5903084cf1813412c8bacb003.tar.xz |
vo_gpu_next: make `dither-depth=auto` mean 8 bpc for non-d3d11 SDR
Fixes the issue described in https://github.com/mpv-player/mpv/issues/11862
for SDR files for non-d3d11 gpu-api. We currently don't have a smarter
way to get the real on-the-wire bpc for other APIs, so this is the best
that can be done.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/vo_gpu_next.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 3c5f558473..0faf811733 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -841,7 +841,11 @@ static void apply_target_options(struct priv *p, struct pl_frame *target) int dither_depth = opts->dither_depth; if (dither_depth == 0) { struct ra_swapchain *sw = p->ra_ctx->swapchain; - dither_depth = sw->fns->color_depth ? sw->fns->color_depth(sw) : 0; + if (sw->fns->color_depth) { + dither_depth = sw->fns->color_depth(sw); + } else if (!pl_color_transfer_is_hdr(target->color.transfer)) { + dither_depth = 8; + } } if (dither_depth > 0) { struct pl_bit_encoding *tbits = &target->repr.bits; |