From b637d6366cfe858accba02c9e50046a6acb81493 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 26 Dec 2015 18:36:55 +0100 Subject: vo_opengl: fix gray playback Commit f24ba544 wasn't an equivalent change. (This shit needs some sort of automated tests.) --- video/csputils.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'video') diff --git a/video/csputils.c b/video/csputils.c index 479c411322..08c484ffda 100644 --- a/video/csputils.c +++ b/video/csputils.c @@ -655,13 +655,12 @@ void mp_get_csp_matrix(struct mp_csp_params *params, struct mp_cmat *m) }; if ((colorspace == MP_CSP_BT_601 || colorspace == MP_CSP_BT_709 || - colorspace == MP_CSP_SMPTE_240M || colorspace == MP_CSP_BT_2020_NC) - && !params->gray) + colorspace == MP_CSP_SMPTE_240M || colorspace == MP_CSP_BT_2020_NC)) { // Hue is equivalent to rotating input [U, V] subvector around the origin. // Saturation scales [U, V]. - float huecos = params->saturation * cos(params->hue); - float huesin = params->saturation * sin(params->hue); + float huecos = params->gray ? 0 : params->saturation * cos(params->hue); + float huesin = params->gray ? 0 : params->saturation * sin(params->hue); for (int i = 0; i < 3; i++) { float u = m->m[i][1], v = m->m[i][2]; m->m[i][1] = huecos * u - huesin * v; -- cgit v1.2.3