From aaadcef52f1b42e7166517a27968bcb2f322abf2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 18 Aug 2014 22:59:07 +0200 Subject: video: dump vsync phase into stats file For debugging (drawing fun plots with TOOLS/stats-conv.py). Also move last_flip under the correct comment: it's not protected by the lock, and can be accessed by the VO thread only. --- video/out/vo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'video') diff --git a/video/out/vo.c b/video/out/vo.c index acad2cf69f..f047704c05 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -133,7 +133,6 @@ struct vo_internal { int64_t flip_queue_offset; // queue flip events at most this much in advance - int64_t last_flip; int64_t drop_count; bool dropped_frame; // the previous frame was dropped struct mp_image *dropped_image; // used to possibly redraw the dropped frame @@ -147,6 +146,7 @@ struct vo_internal { // --- The following fields can be accessed from the VO thread only int64_t vsync_interval; + int64_t last_flip; char *window_title; }; @@ -591,7 +591,9 @@ static bool render_frame(struct vo *vo) in->last_flip = mp_time_us(); - MP_DBG(vo, "phase: %ld\n", (long)(in->last_flip % in->vsync_interval)); + long phase = in->last_flip % in->vsync_interval; + MP_DBG(vo, "phase: %ld\n", phase); + MP_STATS(vo, "value %ld phase", phase); pthread_mutex_lock(&in->lock); } -- cgit v1.2.3