From a60e725113ff4b932be84dc84d3095ac65fe287a Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Wed, 25 Mar 2015 23:06:46 +0100 Subject: [PATCH] vo_opengl: add FBOTEX_FUZZY alias Minor reusability factor --- video/out/gl_utils.h | 1 + video/out/gl_video.c | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/video/out/gl_utils.h b/video/out/gl_utils.h index c55ee8acfa..2c55e72c44 100644 --- a/video/out/gl_utils.h +++ b/video/out/gl_utils.h @@ -84,6 +84,7 @@ bool fbotex_change(struct fbotex *fbo, GL *gl, struct mp_log *log, int w, int h, GLenum iformat, int flags); #define FBOTEX_FUZZY_W 1 #define FBOTEX_FUZZY_H 2 +#define FBOTEX_FUZZY (FBOTEX_FUZZY_W | FBOTEX_FUZZY_H) void fbotex_set_filter(struct fbotex *fbo, GLenum gl_filter); // A 3x2 matrix, with the translation part separate. diff --git a/video/out/gl_video.c b/video/out/gl_video.c index f397c702d4..0afd1bed7e 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -1769,8 +1769,7 @@ static void pass_render_frame(struct gl_video *p) get_scale_factors(p, scale); rect.ml *= scale[0]; rect.mr *= scale[0]; rect.mt *= scale[1]; rect.mb *= scale[1]; - finish_pass_fbo(p, &p->blend_subs_fbo, vp_w, vp_h, 0, - FBOTEX_FUZZY_W | FBOTEX_FUZZY_H); + finish_pass_fbo(p, &p->blend_subs_fbo, vp_w, vp_h, 0, FBOTEX_FUZZY); double vpts = p->image.mpi->pts; if (vpts == MP_NOPTS_VALUE) vpts = p->osd_pts; @@ -1794,15 +1793,14 @@ static void gl_video_interpolate_frame(struct gl_video *p, int fbo, struct frame_timing *t) { int vp_w = p->dst_rect.x1 - p->dst_rect.x0, - vp_h = p->dst_rect.y1 - p->dst_rect.y0, - fuzz = FBOTEX_FUZZY_W | FBOTEX_FUZZY_H; + vp_h = p->dst_rect.y1 - p->dst_rect.y0; // First of all, figure out if we have a frame availble at all, and draw // it manually + reset the queue if not if (!p->surfaces[p->surface_now].pts) { pass_render_frame(p); finish_pass_fbo(p, &p->surfaces[p->surface_now].fbotex, - vp_w, vp_h, 0, fuzz); + vp_w, vp_h, 0, FBOTEX_FUZZY); p->surfaces[p->surface_now].pts = t ? t->pts : 0; p->surfaces[p->surface_now].vpts = p->image.mpi->pts; p->surface_idx = p->surface_now; @@ -1838,7 +1836,7 @@ static void gl_video_interpolate_frame(struct gl_video *p, int fbo, MP_STATS(p, "new-pts"); pass_render_frame(p); finish_pass_fbo(p, &p->surfaces[surface_dst].fbotex, - vp_w, vp_h, 0, fuzz); + vp_w, vp_h, 0, FBOTEX_FUZZY); p->surfaces[surface_dst].pts = t->pts; p->surfaces[surface_dst].vpts = p->image.mpi->pts; p->surface_idx = surface_dst;