alsa/0012-test-latency-fix-timediff-calculation.patch

27 lines
721 B
Diff

From eb3768563a29189156b7117d975930aee8133586 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Wed, 4 Aug 2010 19:47:01 +0200
Subject: [PATCH 12/21] test/latency: fix timediff calculation
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
test/latency.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/latency.c b/test/latency.c
index 304e012..03d65a2 100644
--- a/test/latency.c
+++ b/test/latency.c
@@ -321,7 +321,7 @@ long timediff(snd_timestamp_t t1, snd_timestamp_t t2)
l = (signed long) t1.tv_usec - (signed long) t2.tv_usec;
if (l < 0) {
t1.tv_sec--;
- l = -l;
+ l = 1000000 + l;
l %= 1000000;
}
return (t1.tv_sec * 1000000) + l;
--
1.7.2.1