浏览代码

libobs/util: Fix tv_nsec becoming 1000000000 in os_event_timedwait

Norihiro Kamae 11 月之前
父节点
当前提交
099bc26bd6
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      libobs/util/threading-posix.c

+ 1 - 1
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;
 	}