From d0a8b571c947a262fe396c5f1d29b80649ed997e Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Mon, 28 Jul 2014 05:56:47 +0200 Subject: 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 --- video/csputils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/video/csputils.c b/video/csputils.c index c462c43c34..1cbaf47de9 100644 --- a/video/csputils.c +++ b/video/csputils.c @@ -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}, -- cgit v1.2.3