From 0329b8135474f74b31737da78ae6671b62fa007f Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sun, 15 Mar 2015 23:25:01 +0100 Subject: vo_opengl: improve interpolation diagnostics This adds extra debugging output for buffer underruns, to help track down possible queueing issues. It also inverts the numberic output for tscale=oversample to make more sense, without changing the logic. --- video/out/gl_video.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/video/out/gl_video.c b/video/out/gl_video.c index ec15f4ce62..ffe1aaaab9 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -1778,11 +1778,13 @@ static void gl_video_interpolate_frame(struct gl_video *p, int fbo, // Possible causes for failure of this condition include seeks, pausing, // end of playback or start of playback. bool valid = true; - for (int i = surface_bse; i != surface_end; i = fbosurface_wrap(i+1)) { - if (!p->surfaces[i].pts || - p->surfaces[fbosurface_wrap(i+1)].pts < p->surfaces[i].pts) { + for (int i = surface_bse, ii; valid && i != surface_end; i = ii) { + ii = fbosurface_wrap(i+1); + if (!p->surfaces[i].pts || !p->surfaces[ii].pts) { valid = false; - break; + } else if (p->surfaces[ii].pts < p->surfaces[i].pts) { + valid = false; + MP_DBG(p, "interpolation queue underrun\n"); } } @@ -1802,9 +1804,10 @@ static void gl_video_interpolate_frame(struct gl_video *p, int fbo, mix = (pts_nxt - t->next_vsync) / vsync_interval; mix = mix <= 0 + threshold ? 0 : mix; mix = mix >= 1 - threshold ? 1 : mix; + mix = 1 - mix; gl_sc_uniform_f(p->sc, "inter_coeff", mix); - GLSL(vec4 color = mix(texture(texture1, texcoord1), - texture(texture0, texcoord0), + GLSL(vec4 color = mix(texture(texture0, texcoord0), + texture(texture1, texcoord1), inter_coeff);) } else { mix = (t->next_vsync - pts_now) / fscale; -- cgit v1.2.3