Skip to content

Fix duration inflation caused by late-subscribing tracks#859

Merged
milos-lk merged 1 commit intomainfrom
fix-end-time
Mar 13, 2026
Merged

Fix duration inflation caused by late-subscribing tracks#859
milos-lk merged 1 commit intomainfrom
fix-end-time

Conversation

@milos-lk
Copy link
Copy Markdown
Contributor

End() previously computed endedAt as wallclock + max PTS offset, which included the late-subscription base offset (e.g. +44s for a track that joined 44s late), inflating reported duration far beyond actual recording time. This replaces the offset-based computation with the actual max adjusted PTS reached by any track, making both endedAt and the drain ceiling directly reflect the media timeline.

End() previously computed endedAt as wallclock + max PTS offset, which included the late-subscription base offset (e.g. +44s for a track that joined 44s late), inflating reported duration far beyond actual recording time. This replaces the offset-based computation with the actual max adjusted PTS reached by any track, making both endedAt and the drain ceiling directly reflect the media timeline.
Copy link
Copy Markdown
Contributor

@biglittlebigben biglittlebigben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@milos-lk milos-lk merged commit 4493ba0 into main Mar 13, 2026
7 checks passed
@milos-lk milos-lk deleted the fix-end-time branch March 13, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants