1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-11 08:37:59 +00:00

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.
This commit is contained in:
Niklas Haas 2016-05-16 14:07:39 +02:00
parent b6c40953cb
commit 3bdbf6274c
No known key found for this signature in database
GPG Key ID: 9A09076581B27402

View File

@ -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;
}