Commit ffa12a138a6e440799ada6efed9279f9c7906af6

Con Kolivas 2013-08-18T14:35:01

Fix missed endtimeperiod in overrun timer on windows.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/util.c b/util.c
index fef5dd6..ad32279 100644
--- a/util.c
+++ b/util.c
@@ -945,10 +945,11 @@ static void nanosleep_abstime(struct timespec *ts_end)
 	gettimeofday(&now, NULL);
 	now_ns = timeval_to_ns(&now);
 	if (unlikely(now_ns >= end_ns))
-		return;
+		goto out;
 	diff_ns = end_ns - now_ns;
 	ns_to_timespec(&ts_diff, diff_ns);
 	nanosleep(&ts_diff, NULL);
+out:
 #ifdef WIN32
 	timeEndPeriod(1);
 #endif