summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2017-01-26 09:24:35 +0200
committerJari Vetoniemi <mailroxas@gmail.com>2017-01-26 09:24:35 +0200
commit65f107686e6449de6b3cb603397a7f2aa0e60f8b (patch)
tree85deaf4d206a482af52df496c10883aa76a64516
parent63aeb9cafae4102fd62a0d88e6723be2eafe8a7f (diff)
Drop only half frames, add warning for drops
-rw-r--r--glcapture.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/glcapture.c b/glcapture.c
index 37a0e81..d1c7b89 100644
--- a/glcapture.c
+++ b/glcapture.c
@@ -455,10 +455,12 @@ capture_frame(struct gl *gl, const GLint view[4])
{
static __thread uint64_t last_time;
const uint64_t ts = get_time_ns();
- const uint64_t rate = 1e9 / FPS;
+ const uint64_t rate = (1e9 / FPS) / 2;
- if (DROP_FRAMES && last_time > 0 && ts - last_time < rate)
+ if (DROP_FRAMES && last_time > 0 && ts - last_time <= rate) {
+ WARNX("WARNING: dropping frame (%.2f <= %.2f)", (ts - last_time) / 1e6, rate / 1e6);
return;
+ }
last_time = ts;