This is useful when dealing with timestamps returned by various
ancillary PHC ioctl kernel APIs, such as extts.
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Currently there is a method to convert a timespec into a tmv_t, but
not the other way round. This patch adds the missing function in
anticipation of a new feature that will need this conversion.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Added check so that convertion from a positive tmv not result in a negative TimeInterval and vice versa.
Signed-off-by: Anders Selhammer <anders.selhammer@est.tech>
Enforce the use of the tmv_t wrapper functions by converting tmv_t
from an int64_t to a struct containing an int64_t.
Inspection of the disassembly shows that this change has essentially
no impact on the resulting object code, at least for x86_64 with
compiler optimisations enabled.
RC:
- Fixed up after dropping one previous patch in the series.
- Removed the new function, tmv_to_Timestamp, as that will
be introduced later on.
Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
The sign of time values is tested in tsproc.c. Add an abstraction
tmv_sign() to return the sign of a time value.
Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
Time values are compared using an inequality test in mmedian.c
Generalise tmv_eq() to tmv_cmp() (by analogy with memcmp()) and
replace existing uses of tmv_eq().
Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
Previouly the peer delay was not taking into account the
frequency offset between the local clock and the peer's clock.
Reset neighborRateRatio to 1.0 in port_nrate_initialize().
Signed-off-by: Delio Brignoli <dbrignoli@audioscience.com>
If a buggy driver or hardware delivers bogus time stamps, then we might
crash with a divide by zero exception.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
This is really just a first attempt using a hard coded length. Probably
it will be necessary to let the length be configurable and/or adaptable.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>