aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-01-05 22:29:30 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-01-05 22:29:30 +0000
commit324d56b5a600a42cc52111cd2e8440d02d2256fd (patch)
tree9d418424af7d019c55abe916b3ab816df0dc7b82 /channel.c
parentfeec201e5b3012ff339e904066f60bd6a474b9ce (diff)
Calculate tvdiff properly (avoid off-by-one)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4682 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rwxr-xr-xchannel.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/channel.c b/channel.c
index 467fbc9e5..efd6486a1 100755
--- a/channel.c
+++ b/channel.c
@@ -2546,7 +2546,11 @@ int ast_setstate(struct ast_channel *chan, int state)
static long tvdiff(struct timeval *now, struct timeval *then)
{
+#if 0
return (((now->tv_sec * 1000) + now->tv_usec / 1000) - ((then->tv_sec * 1000) + then->tv_usec / 1000));
+#else
+ return (now->tv_sec - then->tv_sec) * 1000 + (now->tv_usec - then->tv_usec) / 1000;
+#endif
}
struct ast_channel *ast_bridged_channel(struct ast_channel *chan)