summaryrefslogtreecommitdiffstats
path: root/osdep/timer.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-10-11 15:19:14 -0500
committerDudemanguy <random342@airmail.cc>2023-10-16 15:38:59 +0000
commit8f432b2e37bd2d421c21f828e41973710dfb8118 (patch)
tree522cf8da9821426f9a33d19114efa782ee2dcfed /osdep/timer.c
parentbb036c67f4708e2bc10e7a382e447d40681208b8 (diff)
downloadmpv-8f432b2e37bd2d421c21f828e41973710dfb8118.tar.bz2
mpv-8f432b2e37bd2d421c21f828e41973710dfb8118.tar.xz
timer: remove microsecond timer functions
With the previous series of commits, all internal usage has been replaced by the nanosecond functions. There's not really any point in keeping these around anymore plus there are macros for unit conversions now so we can just axe them. It's worth noting that mpv_get_time_us() obviously still needs to work for API reasons, but we can just divide mp_time_ns() by 1000 to get the same thing.
Diffstat (limited to 'osdep/timer.c')
-rw-r--r--osdep/timer.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/osdep/timer.c b/osdep/timer.c
index 3e48329ba2..e939ef5dd5 100644
--- a/osdep/timer.c
+++ b/osdep/timer.c
@@ -48,11 +48,6 @@ void mp_time_init(void)
pthread_once(&timer_init_once, do_timer_init);
}
-int64_t mp_time_us(void)
-{
- return mp_time_ns() / 1000;
-}
-
int64_t mp_time_ns(void)
{
uint64_t r = mp_raw_time_ns() - raw_time_offset;
@@ -66,18 +61,6 @@ double mp_time_sec(void)
return mp_time_ns() / 1e9;
}
-int64_t mp_time_us_add(int64_t time_us, double timeout_sec)
-{
- assert(time_us > 0); // mp_time_us() returns strictly positive values
- double t = MPCLAMP(timeout_sec * 1e6, -0x1p63, 0x1p63);
- int64_t ti = t == 0x1p63 ? INT64_MAX : (int64_t)t;
- if (ti > INT64_MAX - time_us)
- return INT64_MAX;
- if (ti <= -time_us)
- return 1;
- return time_us + ti;
-}
-
int64_t mp_time_ns_add(int64_t time_ns, double timeout_sec)
{
assert(time_ns > 0); // mp_time_ns() returns strictly positive values
@@ -106,11 +89,6 @@ static int get_realtime(struct timespec *out_ts)
}
#endif
-struct timespec mp_time_us_to_realtime(int64_t time_us)
-{
- return mp_time_ns_to_realtime(MPMIN(INT64_MAX / 1000, time_us) * 1000);
-}
-
struct timespec mp_time_ns_to_realtime(int64_t time_ns)
{
struct timespec ts = {0};