From fb94744595aabfa665e0799e9b386e77633c1818 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 30 Aug 2015 23:00:39 +0200 Subject: 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.) --- video/out/gl_video.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/video/out/gl_video.c b/video/out/gl_video.c index 4eb4030244..d5af6efcfc 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -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); -- cgit v1.2.3