From fae9f8bded55e64f09339f155a616ae8241ce5c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Tue, 16 Apr 2024 09:42:48 -0500 Subject: [PATCH] feat: time in manifest --- docs/guide/rts.md | 3 ++- src/core/streams/rts.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/guide/rts.md b/docs/guide/rts.md index 2cdc62175..9b071b46e 100644 --- a/docs/guide/rts.md +++ b/docs/guide/rts.md @@ -16,7 +16,8 @@ Header { } Body { - primary uint8 base; + uint32 time; + uint8 base; } ``` diff --git a/src/core/streams/rts.ts b/src/core/streams/rts.ts index 438ca1d18..2d9b0d0e9 100644 --- a/src/core/streams/rts.ts +++ b/src/core/streams/rts.ts @@ -33,6 +33,7 @@ export class RtsmReadStream extends ReadStream { body() { return { + time: this.uint32(), base: this.uint8(), }; } @@ -56,6 +57,7 @@ export class RtsmWriteStream extends WriteStream { } body(base: number) { + this.uint32(Math.round(Date.now() / 1000)); this.uint8(base); } }