Skip to content

Commit

Permalink
Increase video timestamping precision from milli to micro (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
holofermes authored Dec 24, 2024
1 parent 5b0cce0 commit 9198fcc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Runtime/Scripts/RtcVideoSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ protected virtual bool SendFrame()
var capture = request.request;
capture.SourceHandle = (ulong)Handle.DangerousGetHandle();
capture.Rotation = GetVideoRotation();
capture.TimestampUs = DateTimeOffset.Now.ToUnixTimeMilliseconds();
var now = DateTimeOffset.UtcNow;
capture.TimestampUs = now.ToUnixTimeMilliseconds() * 1000 + (now.Ticks % TimeSpan.TicksPerMillisecond) / 10;
capture.Buffer = buffer;
using var response = request.Send();
_reading = false;
Expand Down

0 comments on commit 9198fcc

Please sign in to comment.