summaryrefslogtreecommitdiffstats
path: root/osdep/semaphore_osx.c
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2023-10-27 01:24:41 +0600
committerDudemanguy <random342@airmail.cc>2023-10-27 18:07:19 +0000
commit8bbcc87feea7abf256a6c7f511244d09f5520c17 (patch)
tree069ce26d65fa713aec56592f53a51bfd6e48d5d2 /osdep/semaphore_osx.c
parent2f91e1441e46f80d12998520b7ebce44c28e1da6 (diff)
downloadmpv-8bbcc87feea7abf256a6c7f511244d09f5520c17.tar.bz2
mpv-8bbcc87feea7abf256a6c7f511244d09f5520c17.tar.xz
timer: remove MP_START_TIME
instead require mp_raw_time_ns() to not return 0, which all current implementation already should follow.
Diffstat (limited to 'osdep/semaphore_osx.c')
-rw-r--r--osdep/semaphore_osx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/osdep/semaphore_osx.c b/osdep/semaphore_osx.c
index e8ba7b72b5..c820bace78 100644
--- a/osdep/semaphore_osx.c
+++ b/osdep/semaphore_osx.c
@@ -46,7 +46,7 @@ int mp_sem_init(mp_sem_t *sem, int pshared, unsigned int value)
int mp_sem_wait(mp_sem_t *sem)
{
- return mp_sem_timedwait(sem, MP_START_TIME - 1);
+ return mp_sem_timedwait(sem, -1);
}
int mp_sem_trywait(mp_sem_t *sem)
@@ -76,9 +76,9 @@ int mp_sem_timedwait(mp_sem_t *sem, int64_t until)
return 0;
int timeout = 0;
- if (until == MP_START_TIME - 1) {
+ if (until == -1) {
timeout = -1;
- } else if (until >= MP_START_TIME) {
+ } else if (until >= 0) {
timeout = (until - mp_time_ns()) / MP_TIME_MS_TO_NS(1);
timeout = MPCLAMP(timeout, 0, INT_MAX);
} else {