summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/video.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-01-26 20:47:12 +0100
committerwm4 <wm4@nowhere>2016-01-26 21:35:23 +0100
commitbeb7094301a73d3af056982601ace45b8f3e7039 (patch)
tree5fadd91818fdb2c5101ffbc536a96607fa414ba8 /video/out/opengl/video.c
parentfc3ca14ef70476762e321eb80e037c02e4bb41b5 (diff)
downloadmpv-beb7094301a73d3af056982601ace45b8f3e7039.tar.bz2
mpv-beb7094301a73d3af056982601ace45b8f3e7039.tar.xz
vo_opengl: actually reset use_normalized_range field
This was never reset - absolutely can't be right. If the renderer somehow switches back to another codepath, it certainly has to be reset. Maybe this was hard to hit, as the normalization is going to be idempotent in simpler cases (like rendering RGBA input). Also get rid of the "merged" variable.
Diffstat (limited to 'video/out/opengl/video.c')
-rw-r--r--video/out/opengl/video.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index 283a7cf0e5..9a3b0c16f2 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -1337,6 +1337,8 @@ static bool pass_prescale_luma(struct gl_video *p, float tex_mul,
// sample from video textures, set "color" variable to yuv value
static void pass_read_video(struct gl_video *p)
{
+ p->use_normalized_range = false;
+
struct gl_transform chromafix;
pass_set_image_textures(p, &p->image, &chromafix);
@@ -1363,7 +1365,6 @@ static void pass_read_video(struct gl_video *p)
int c_h = p->pass_tex[1].src.y1 - p->pass_tex[1].src.y0;
const struct scaler_config *cscale = &p->opts.scaler[2];
- bool merged = false;
if (p->plane_count > 2) {
// For simplicity and performance, we merge the chroma planes
// into a single texture before scaling or debanding, so the shader
@@ -1379,12 +1380,11 @@ static void pass_read_video(struct gl_video *p)
assert(c_h == p->pass_tex[2].src.y1 - p->pass_tex[2].src.y0);
finish_pass_fbo(p, &p->chroma_merge_fbo, c_w, c_h, 1, 0);
p->use_normalized_range = true;
- merged = true;
}
if (p->opts.deband) {
pass_sample_deband(p->sc, p->opts.deband_opts, 1, p->gl_target,
- merged ? 1.0 : tex_mul,
+ p->use_normalized_range ? 1.0 : tex_mul,
p->texture_w, p->texture_h, &p->lfg);
GLSL(color.zw = vec2(0.0, 1.0);) // skip unused
finish_pass_fbo(p, &p->chroma_deband_fbo, c_w, c_h, 1, 0);