vo_opengl: fix alpha video in one case

yuva444p worked, yuva420p didn't. This happened because the chroma pass
discards the alpha plane, which is referenced by the alpha blend code
later.

Add a terrible hack to work this around, actually using the same hack as
was used for the Y plane. (A terrible hack for terrible code.)
This commit is contained in:
wm4 2015-08-30 23:00:39 +02:00
parent 82f0d373fb
commit fb94744595
1 changed files with 2 additions and 0 deletions

View File

@ -1450,6 +1450,7 @@ static void pass_read_video(struct gl_video *p)
// Chroma preprocessing (merging -> shaders -> scaling)
struct src_tex luma = p->pass_tex[0];
struct src_tex alpha = p->pass_tex[3];
int c_w = p->pass_tex[1].src.x1 - p->pass_tex[1].src.x0;
int c_h = p->pass_tex[1].src.y1 - p->pass_tex[1].src.y0;
const struct scaler_config *cscale = &p->opts.scaler[2];
@ -1510,6 +1511,7 @@ static void pass_read_video(struct gl_video *p)
}
p->pass_tex[0] = luma; // Restore the luma plane
p->pass_tex[3] = alpha; // Restore the alpha plane (if set)
if (shader) {
load_shader(p, shader);
gl_sc_uniform_f(p->sc, "cmul", cmul);