1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-22 23:02:37 +00:00

video: add a default color space for files with no video

Usually mp_image_params_guess_csp takes care of finding *some* default
for a video channel, but files with no video (or with extremely broken
configurations) end up leaving the colorspace information as
MP_CSP_PRIM_AUTO, which has no associated primaries.

As a result of this, color managed OSD messages could not display
because they were being color managed to match the (non-existing/absurd)
video channel. With this change, such non-spaces will have BT.709
primaries as far as color management and the OSD is concerned.

This fixes #961.

CC: @mpv-player/stable

Signed-off-by: wm4 <wm4@nowhere>
This commit is contained in:
Niklas Haas 2014-07-28 05:56:47 +02:00 committed by wm4
parent 261506e36e
commit d0a8b571c9

View File

@ -305,6 +305,9 @@ struct mp_csp_primaries mp_get_csp_primaries(enum mp_csp_prim spc)
.blue = {0.150, 0.060},
.white = d65
};
// This is the default assumption if no colorspace information could
// be determined, eg. for files which have no video channel.
case MP_CSP_PRIM_AUTO:
case MP_CSP_PRIM_BT_709:
return (struct mp_csp_primaries) {
.red = {0.640, 0.330},