Skip to content

Commit b261d6c

Browse files
committed
libvlc: add helper delay function
1 parent 6e85740 commit b261d6c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/LibVLCSharp/Shared/LibVLC.cs

+7
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,13 @@ static void GetLogContext(IntPtr logContext, out string? module, out string? fil
776776
/// </summary>
777777
public long Clock => Native.LibVLCClock();
778778

779+
/// <summary>
780+
/// Return the delay (in microseconds) until a certain timestamp.
781+
/// </summary>
782+
/// <param name="pts">timestamp in microsecond</param>
783+
/// <returns>negative if timestamp is in the past, positive if it is in the future</returns>
784+
public long Delay(long pts) => pts - Clock;
785+
779786
#region Exit
780787

781788
static readonly InternalExitCallback ExitCallbackHandle = ExitCallback;

0 commit comments

Comments
 (0)