[vlc-devel] [PATCH] posix/wait: Fix timespec calculation

Marvin Scholz epirat07 at gmail.com
Sat Mar 7 11:45:03 CET 2020


---
 src/posix/wait.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/posix/wait.c b/src/posix/wait.c
index a6d58d721b..dfb0c508db 100644
--- a/src/posix/wait.c
+++ b/src/posix/wait.c
@@ -119,7 +119,7 @@ static void vlc_timespec_adjust(clockid_t cid, struct timespec *restrict ts)
     clock_gettime(vlc_clock_id, &now_to);
 
     d = lldiv((ts->tv_sec - now_from.tv_sec + now_to.tv_sec) * 1000000000LL
-              + ts->tv_nsec - now_from.tv_nsec - now_to.tv_nsec, 1000000000LL);
+              + ts->tv_nsec - now_from.tv_nsec + now_to.tv_nsec, 1000000000LL);
 
     ts->tv_sec = d.quot;
     ts->tv_nsec = d.rem;
-- 
2.21.1 (Apple Git-122.3)



More information about the vlc-devel mailing list