summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-18 22:59:07 +0200
committerwm4 <wm4@nowhere>2014-08-18 23:04:28 +0200
commitaaadcef52f1b42e7166517a27968bcb2f322abf2 (patch)
tree85cf7152ccbd65471d6fb61f35762ace938f8048 /video
parent7520d39e8bcc0c359f6fcccf08f45313058e5740 (diff)
downloadmpv-aaadcef52f1b42e7166517a27968bcb2f322abf2.tar.bz2
mpv-aaadcef52f1b42e7166517a27968bcb2f322abf2.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo.c6
1 files changed, 4 insertions, 2 deletions
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);
}