From 895932aa0a33a71b49b4668b5bed884d0ebf39e4 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 22 Dec 2013 15:48:38 +0100 Subject: vo_vdpau: add some debugging messages for frame timing Note that this will print a difference even with perfect sync, because the code queues the frames _between_ vsync, probably for error margin (though I don't understand why it uses the exact values chosen). --- video/out/vo_vdpau.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index 9e92b29bc6..43e21209da 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -1020,10 +1020,12 @@ static int update_presentation_queue_status(struct vo *vo) break; if (vc->vsync_interval > 1) { uint64_t qtime = vc->queue_time[vc->query_surface_num]; + int diff = ((int64_t)vtime - (int64_t)qtime) / 1e6; + MP_TRACE(vo, "Queue time difference: %d ms\n", diff); if (vtime < qtime + vc->vsync_interval / 2) - MP_VERBOSE(vo, "Frame shown too early\n"); + MP_VERBOSE(vo, "Frame shown too early (%d ms)\n", diff); if (vtime > qtime + vc->vsync_interval) - MP_VERBOSE(vo, "Frame shown late\n"); + MP_VERBOSE(vo, "Frame shown late (%d ms)\n", diff); } vc->query_surface_num = WRAP_ADD(vc->query_surface_num, 1, vc->num_output_surfaces); -- cgit v1.2.3