Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cmeng-git opened this issue Sep 24, 2018 · 0 comments

Comments

@cmeng-git
Copy link

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


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant