From 16e8ecb0313f9aa7ef17ec8cb2b19ce9937a6bf6 Mon Sep 17 00:00:00 2001 From: igv Date: Sun, 19 Mar 2017 16:13:51 +0200 Subject: vo_opengl: replace uniform variable image_size with input_size input_size can be the size of a cropped image Signed-off-by: wm4 --- video/out/opengl/video.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'video') diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index f6db1514f5..14b1150207 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -1224,8 +1224,11 @@ static void load_shader(struct gl_video *p, struct bstr body) gl_sc_hadd_bstr(p->sc, body); gl_sc_uniform_f(p->sc, "random", (double)av_lfg_get(&p->lfg) / UINT32_MAX); gl_sc_uniform_f(p->sc, "frame", p->frames_uploaded); - gl_sc_uniform_vec2(p->sc, "image_size", (GLfloat[]){p->image_params.w, - p->image_params.h}); + gl_sc_uniform_vec2(p->sc, "input_size", + (GLfloat[]){(p->src_rect.x1 - p->src_rect.x0) * + p->texture_offset.m[0][0], + (p->src_rect.y1 - p->src_rect.y0) * + p->texture_offset.m[1][1]}); gl_sc_uniform_vec2(p->sc, "target_size", (GLfloat[]){p->dst_rect.x1 - p->dst_rect.x0, p->dst_rect.y1 - p->dst_rect.y0}); -- cgit v1.2.3