[vlc-commits] opengl: converter: fix planar16
Thomas Guillem
git at videolan.org
Thu Feb 2 16:33:40 CET 2017
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Feb 2 16:30:03 2017 +0100| [68f8b033bf57677cac75305dde878a1639c99d48] | committer: Thomas Guillem
opengl: converter: fix planar16
This fixes a regression from 4df4a4d.
Fix #17969
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=68f8b033bf57677cac75305dde878a1639c99d48
---
modules/video_output/opengl/converters.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/modules/video_output/opengl/converters.c b/modules/video_output/opengl/converters.c
index 49df500..d8112a5 100644
--- a/modules/video_output/opengl/converters.c
+++ b/modules/video_output/opengl/converters.c
@@ -130,8 +130,13 @@ tc_yuv_base_init(opengl_tex_converter_t *tc, GLenum tex_target,
if (desc->plane_count == 3)
{
GLint internal = 0;
+ GLenum type = 0;
+
if (desc->pixel_size == 1)
+ {
internal = oneplane_texfmt;
+ type = GL_UNSIGNED_BYTE;
+ }
#if !defined(USE_OPENGL_ES2)
else if (desc->pixel_size == 2)
{
@@ -141,6 +146,7 @@ tc_yuv_base_init(opengl_tex_converter_t *tc, GLenum tex_target,
return VLC_EGENERIC;
internal = oneplane16_texfmt;
+ type = GL_UNSIGNED_SHORT;
yuv_range_correction = (float)((1 << 16) - 1)
/ ((1 << desc->pixel_bits) - 1);
}
@@ -148,7 +154,7 @@ tc_yuv_base_init(opengl_tex_converter_t *tc, GLenum tex_target,
else
return VLC_EGENERIC;
- assert(internal != 0);
+ assert(internal != 0 && type != 0);
tc->tex_count = 3;
for (unsigned i = 0; i < tc->tex_count; ++i )
@@ -156,7 +162,7 @@ tc_yuv_base_init(opengl_tex_converter_t *tc, GLenum tex_target,
tc->texs[i] = (struct opengl_tex_cfg) {
{ desc->p[i].w.num, desc->p[i].w.den },
{ desc->p[i].h.num, desc->p[i].h.den },
- internal, oneplane_texfmt, GL_UNSIGNED_BYTE
+ internal, oneplane_texfmt, type
};
}
More information about the vlc-commits
mailing list