summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2015-03-15 23:25:01 +0100
committerwm4 <wm4@nowhere>2015-03-16 09:29:50 +0100
commit0329b8135474f74b31737da78ae6671b62fa007f (patch)
tree46fb7c91abcc9978eadca6c30062ed20851e4d96
parentce2da9cfcf23ea5170d026670fc0e87892818b6c (diff)
downloadmpv-0329b8135474f74b31737da78ae6671b62fa007f.tar.bz2
mpv-0329b8135474f74b31737da78ae6671b62fa007f.tar.xz
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.
-rw-r--r--video/out/gl_video.c15
1 files 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;