diff options
author | Niklas Haas <git@nand.wakku.to> | 2016-05-16 14:07:39 +0200 |
---|---|---|
committer | Niklas Haas <git@nand.wakku.to> | 2016-05-16 14:07:39 +0200 |
commit | 3bdbf6274c67224112b685ff15be7ecd8c21f4c7 (patch) | |
tree | 5ac7d4d1e83599a4ac803cca1da1679914c32839 /video/out/opengl/video.c | |
parent | b6c40953cbb640d8ec9e3fa9862e243c0dbb1d17 (diff) |
vo_opengl: fall back to gamma2.2 by default for HDR content
Since HDR content is now auto-detected as such, we should probably do
something smarter in the "no configuration" case, such as outputting
gamma 2.2 instead.
This decision will affect the majority of users of stock configurations
who just play back appropriately tagged HDR files, so having a good
default behavior is important. "Output the HDR content as-is" is
definitely not likely to give the user a good result.
Diffstat (limited to 'video/out/opengl/video.c')
-rw-r--r-- | video/out/opengl/video.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 2ee3cd7bcb..3b31711f86 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -2240,10 +2240,15 @@ static void pass_colormanage(struct gl_video *p, bool display_scaled, prim_dst = prim_src; if (trc_dst == MP_CSP_TRC_AUTO) { trc_dst = trc_src; - // Avoid outputting linear light at all costs + // Avoid outputting linear light at all costs. First try + // falling back to the image gamma (e.g. in the case that the input + // was linear light due to linear-scaling) if (trc_dst == MP_CSP_TRC_LINEAR) trc_dst = p->image_params.gamma; - if (trc_dst == MP_CSP_TRC_LINEAR) + + // Failing that, pick gamma 2.2 as a reasonable default. This is also + // picked as a default for outputting HDR content + if (trc_dst == MP_CSP_TRC_LINEAR || trc_dst == MP_CSP_TRC_SMPTE_ST2084) trc_dst = MP_CSP_TRC_GAMMA22; } |