summaryrefslogtreecommitdiffstats
path: root/video/out/gl_video.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-06 15:21:26 +0100
committerwm4 <wm4@nowhere>2015-01-06 16:51:02 +0100
commit5410a5b2c55b5c7d9889451c1d6e56c697325a2c (patch)
treee7989451ced95a879a1d92b9037db86fa6b4c9e0 /video/out/gl_video.c
parenta52ca8a2b075388dc7dd5012e4e3f4871e26b133 (diff)
downloadmpv-5410a5b2c55b5c7d9889451c1d6e56c697325a2c.tar.bz2
mpv-5410a5b2c55b5c7d9889451c1d6e56c697325a2c.tar.xz
csputils: move image_params -> csp_params into a function
Although the line count increases, this is better for making sure everything is handled consistently for all users of the mp_csp_params stuff. This also makes sure mp_csp_params is always initialized with MP_CSP_PARAMS_DEFAULTS (for consistency).
Diffstat (limited to 'video/out/gl_video.c')
-rw-r--r--video/out/gl_video.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index 1ff0d9d333..672fb5dafb 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -638,13 +638,10 @@ static void update_uniforms(struct gl_video *p, GLuint program)
gl->UseProgram(program);
- struct mp_csp_params cparams = {
- .colorspace = p->image_params.colorspace,
- .levels_in = p->image_params.colorlevels,
- .levels_out = p->image_params.outputlevels,
- .input_bits = p->plane_bits,
- .texture_bits = (p->plane_bits + 7) & ~7,
- };
+ struct mp_csp_params cparams = MP_CSP_PARAMS_DEFAULTS;
+ cparams.input_bits = p->plane_bits;
+ cparams.texture_bits = (p->plane_bits + 7) & ~7;
+ mp_csp_set_image_params(&cparams, &p->image_params);
mp_csp_copy_equalizer_values(&cparams, &p->video_eq);
if (p->image_desc.flags & MP_IMGFLAG_XYZ) {
cparams.colorspace = MP_CSP_XYZ;