Skip to content

Commit 9198fcc

Browse files
authored
Increase video timestamping precision from milli to micro (#76)
1 parent 5b0cce0 commit 9198fcc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Runtime/Scripts/RtcVideoSource.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ protected virtual bool SendFrame()
188188
var capture = request.request;
189189
capture.SourceHandle = (ulong)Handle.DangerousGetHandle();
190190
capture.Rotation = GetVideoRotation();
191-
capture.TimestampUs = DateTimeOffset.Now.ToUnixTimeMilliseconds();
191+
var now = DateTimeOffset.UtcNow;
192+
capture.TimestampUs = now.ToUnixTimeMilliseconds() * 1000 + (now.Ticks % TimeSpan.TicksPerMillisecond) / 10;
192193
capture.Buffer = buffer;
193194
using var response = request.Send();
194195
_reading = false;

0 commit comments

Comments
 (0)