summaryrefslogtreecommitdiff
path: root/channel.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2005-01-05 22:29:30 +0000
committerMark Spencer <markster@digium.com>2005-01-05 22:29:30 +0000
commitc31621bbecc69191d4065d1250f4e5aff7104610 (patch)
tree9d418424af7d019c55abe916b3ab816df0dc7b82 /channel.c
parentfd5cf4bdec738ec2db25954a1eb91ad6cfb7bbce (diff)
Calculate tvdiff properly (avoid off-by-one)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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)