vo_opengl: avoid broken shader if hwdec fails to provide textures

If gl_hwdec_driver.map_image fails, all textures will be set to 0. This
in turn makes pass_prepare_src_tex() skip generation of the texture
uniforms, which leads to a shader compilation error, as e.g. texture0 is
not defined but expected to exist and accessed.

Set the textures to an invalid non-0 ID instead. OpenGL can deal with
it.
This commit is contained in:
wm4 2015-05-28 21:56:45 +02:00
parent 6f5a10542c
commit c4757ad17c
1 changed files with 4 additions and 1 deletions

View File

@ -667,7 +667,10 @@ static void pass_set_image_textures(struct gl_video *p, struct video_image *vimg
/ vimg->planes[1].tex_h;
if (p->hwdec_active) {
p->hwdec->driver->map_image(p->hwdec, vimg->mpi, imgtex);
if (p->hwdec->driver->map_image(p->hwdec, vimg->mpi, imgtex) < 0) {
for (int n = 0; n < p->plane_count; n++)
imgtex[n] = -1;
}
} else {
for (int n = 0; n < p->plane_count; n++)
imgtex[n] = vimg->planes[n].gl_texture;