From 099bc26bd64629c123ed286e9101dea92c9940e8 Mon Sep 17 00:00:00 2001 From: Norihiro Kamae Date: Wed, 6 Nov 2024 20:48:40 +0900 Subject: [PATCH] libobs/util: Fix tv_nsec becoming 1000000000 in os_event_timedwait --- libobs/util/threading-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libobs/util/threading-posix.c b/libobs/util/threading-posix.c index 6d7c40ee7..ebb0efeb3 100644 --- a/libobs/util/threading-posix.c +++ b/libobs/util/threading-posix.c @@ -97,7 +97,7 @@ static inline void add_ms_to_ts(struct timespec *ts, unsigned long milliseconds) { ts->tv_sec += milliseconds / 1000; ts->tv_nsec += (milliseconds % 1000) * 1000000; - if (ts->tv_nsec > 1000000000) { + if (ts->tv_nsec >= 1000000000) { ts->tv_sec += 1; ts->tv_nsec -= 1000000000; }