From cbbdb5fc496df8d5cc5145ca133f49b2a601faf3 Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Sun, 9 Dec 2001 08:31:20 +0000 Subject: [PATCH] Ciaran found this bug. We only ever set tv_usec, but for bitrates around 32 and lower, this will set tv_usec to > 1 second, which wrong. So we do it the right way, and put seconds in tv_sec. svn path=/trunk/timing/; revision=2507 --- src/timing/timing.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/timing/timing.c b/src/timing/timing.c index 2e3ff0df..af33d055 100644 --- a/src/timing/timing.c +++ b/src/timing/timing.c @@ -36,8 +36,8 @@ void timing_sleep(uint64_t sleeptime) { struct timeval sleeper; - sleeper.tv_sec = 0; - sleeper.tv_usec = sleeptime * 1000; + sleeper.tv_sec = sleeptime / 1000; + sleeper.tv_usec = (sleeptime % 1000) * 1000; /* NOTE: * This should be 0 for the first argument. The linux manpage