libjitsi icon indicating copy to clipboard operation
libjitsi copied to clipboard

TimeUtils.toNtpTime() returned incorrect value to be used in MediaStreamStatsImpl.computeRTTInMs()

Open cmeng-git opened this issue 6 years ago • 0 comments

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;
}

Steps to reproduce


Environment details


cmeng-git avatar Sep 24 '18 05:09 cmeng-git