diff options
Diffstat (limited to 'video/out/gl_video.c')
-rw-r--r-- | video/out/gl_video.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c index cfc85593b1..9d69c822d8 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -182,6 +182,8 @@ struct gl_video { // reinit_rendering must be called bool need_reinit_rendering; + bool is_interpolated; + struct mp_csp_equalizer video_eq; // Source and destination color spaces for the CMS matrix @@ -1728,8 +1730,9 @@ static void gl_video_interpolate_frame(struct gl_video *p, GL *gl = p->gl; double inter_coeff = 0.0; int64_t prev_pts = p->surfaces[fbosurface_next(p)].pts; + p->is_interpolated = prev_pts < t->pts; - if (prev_pts < t->pts) { + if (p->is_interpolated) { MP_STATS(p, "new-pts"); // fbosurface 0 is already bound from the caller p->surfaces[p->surface_idx].pts = t->pts; @@ -1780,6 +1783,8 @@ void gl_video_render_frame(struct gl_video *p, int fbo, struct frame_timing *t) MPSWAP(int, src_rect_rot.x1, src_rect_rot.y1); } + p->is_interpolated = false; + gl->BindFramebuffer(GL_FRAMEBUFFER, fbo); gl->Viewport(p->vp_x, p->vp_y, p->vp_w, p->vp_h); @@ -2224,6 +2229,11 @@ void gl_video_reset(struct gl_video *p) p->surface_idx = 0; } +bool gl_video_showing_interpolated_frame(struct gl_video *p) +{ + return p->is_interpolated; +} + // dest = src.<w> (always using 4 components) static void packed_fmt_swizzle(char w[5], const struct fmt_entry *texfmt, const struct packed_fmt_entry *fmt) |