diff options
author | Niklas Haas <git@haasn.xyz> | 2019-09-15 01:33:27 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.xyz> | 2019-09-15 01:33:27 +0200 |
commit | a416b3f084350fae94049f60ef94f2af10a05f95 (patch) | |
tree | 5657755b3dd70ca5af0ecb2f42bfaeb073755167 /video | |
parent | ee0f4444f9b7e22e6b2b3895bf340f585b0cce70 (diff) | |
download | mpv-a416b3f084350fae94049f60ef94f2af10a05f95.tar.bz2 mpv-a416b3f084350fae94049f60ef94f2af10a05f95.tar.xz |
vo_gpu: correctly normalize src.sig_peak
In some cases, src.sig_peak remains undefined as 0, which was definitely
the case when using the OSD, since it never got passed through the usual
color space normalization process. Most robust work-around is to simply
force the normalization at the site where it's needed. This ensures this
value is always valid and defined, to make the peak-dependent logic in
these two functions always work.
Fixes 4b25ec3a9d
Fixes #6917
Fixes #6918
Diffstat (limited to 'video')
-rw-r--r-- | video/out/gpu/video.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index 4b3d8017a7..b0c43ef20b 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -2539,9 +2539,12 @@ static void pass_colormanage(struct gl_video *p, struct mp_colorspace src, bool } // If there's no specific signal peak known for the output display, infer - // it from the chosen transfer function + // it from the chosen transfer function. Also normalize the src peak, in + // case it was unknown if (!dst.sig_peak) dst.sig_peak = mp_trc_nom_peak(dst.gamma); + if (!src.sig_peak) + src.sig_peak = mp_trc_nom_peak(src.gamma); struct gl_tone_map_opts tone_map = p->opts.tone_map; bool detect_peak = tone_map.compute_peak >= 0 && mp_trc_is_hdr(src.gamma) |