diff options
Diffstat (limited to 'src/core.h')
-rw-r--r-- | src/core.h | 38 |
1 files changed, 2 insertions, 36 deletions
@@ -505,42 +505,8 @@ static inline uint64_t calc_extended_timestamp(uint32_t num_wraps, uint32_t ts) } -static inline uint64_t timestamp_duration(const struct timestamp_recv *ts) -{ - uint64_t last_ext; - - if (!ts || !ts->is_set) - return 0; - - last_ext = calc_extended_timestamp(ts->num_wraps, ts->last); - - return last_ext - ts->first; -} - - -/* - * -1 backwards wrap-around - * 0 no wrap-around - * 1 forward wrap-around - */ -static inline int timestamp_wrap(uint32_t ts_new, uint32_t ts_old) -{ - int32_t delta; - - if (ts_new < ts_old) { - - delta = (int32_t)ts_new - (int32_t)ts_old; - - if (delta > 0) - return 1; - } - else if ((int32_t)(ts_old - ts_new) > 0) { - - return -1; - } - - return 0; -} +int timestamp_wrap(uint32_t ts_new, uint32_t ts_old); +uint64_t timestamp_duration(const struct timestamp_recv *ts); /* |