ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
host_timing.h
Go to the documentation of this file.
1#pragma once
2
4
5/* Preserve the 50 Hz sample clock across scheduler overshoot. Long stalls
6 * resynchronize rather than sending an unbounded burst of overdue packets. */
7static inline bool session_host_audio_due(uint64_t *deadline, uint64_t now) {
8 const uint64_t interval = 20 * NS_PER_MS_INT;
9 if (!*deadline) {
10 *deadline = now + interval;
11 return false;
12 }
13 if (now < *deadline)
14 return false;
15 *deadline = now - *deadline > 100 * NS_PER_MS_INT ? now + interval : *deadline + interval;
16 return true;
17}
unsigned long long uint64_t
Definition common.h:63
#define NS_PER_MS_INT
Definition time.h:168
⏱️ High-precision timing utilities using sokol_time.h and uthash