diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-01-05 22:29:30 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-01-05 22:29:30 +0000 |
commit | 324d56b5a600a42cc52111cd2e8440d02d2256fd (patch) | |
tree | 9d418424af7d019c55abe916b3ab816df0dc7b82 | |
parent | feec201e5b3012ff339e904066f60bd6a474b9ce (diff) |
Calculate tvdiff properly (avoid off-by-one)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4682 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-x | channel.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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) |