libjitsi
libjitsi copied to clipboard
TimeUtils.toNtpTime() returned incorrect value to be used in MediaStreamStatsImpl.computeRTTInMs()
This Issue tracker is only for reporting bugs and tracking code related issues.
Before posting, please make sure you check community.jitsi.org to see if the same or similar bugs have already been discussed. General questions, installation help, and feature requests can also be posted to community.jitsi.org.
Description
The toNtpTime() in TimeUtils computation value is not correct for use in computeRTTInMs calculation.
Current behavior
incorrect RTT result
Expected Behavior
Possible Solution
This proposed method below returns the correct value for use in RTT calculation
public static long toNtpTime(long baseTime)
{
long seconds = baseTime / 1000;
long fraction = ((baseTime % 1000) * 0x100000000L) / 1000;
long time = seconds << 32 | fraction;
return time;
}