Skip to content

Commit 106277f

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

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
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;

src/LibVLCSharp/Shared/MediaPlayer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2039,7 +2039,7 @@ public delegate uint LibVLCVideoFormatCb(ref IntPtr opaque, IntPtr chroma, ref u
20392039
/// <param name="data">data pointer as passed to libvlc_audio_set_callbacks() [IN]</param>
20402040
/// <param name="samples">pointer to a table of audio samples to play back [IN]</param>
20412041
/// <param name="count">number of audio samples to play back</param>
2042-
/// <param name="pts">expected play time stamp (see libvlc_delay())</param>
2042+
/// <param name="pts">expected play time stamp (see <see cref="LibVLC.Delay(long)"/>)</param>
20432043
/// <remarks>
20442044
/// <para>The LibVLC media player decodes and post-processes the audio signal</para>
20452045
/// <para>asynchronously (in an internal thread). Whenever audio samples are ready</para>

0 commit comments

Comments
 (0)