From 869a2b5fbf29d108b55d67faa602003105c0e3da Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Mon, 11 Dec 2023 11:40:32 -0500 Subject: [PATCH] fix timestamp coming from fnecore; --- RtpHeader.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/RtpHeader.cs b/RtpHeader.cs index ec67708..5eee816 100644 --- a/RtpHeader.cs +++ b/RtpHeader.cs @@ -154,12 +154,19 @@ namespace fnecore TimeSpan timeSinceStart = DateTime.Now - start; - uint ts = (uint)rand.Next(int.MinValue, int.MaxValue); ulong microSeconds = (ulong)(timeSinceStart.Ticks * Constants.RtpGenericClockRate); - Timestamp = ts + (uint)(microSeconds / 1000000); + Timestamp = (uint)(microSeconds / 1000000); FneUtils.WriteBytes(Timestamp, ref data, 4); // Timestamp FneUtils.WriteBytes(SSRC, ref data, 8); // Synchronization Source ID } + + /// + /// Helper to reset the start timestamp. + /// + public static void ResetStartTime() + { + start = DateTime.Now; + } } // public class RtpHeader } // namespace fnecore