Skip to content

[codex] fix moq-srt negative pacing offsets#1922

Merged
kixelated merged 1 commit into
mainfrom
codex/fix-srt-negative-pacing
Jun 26, 2026
Merged

[codex] fix moq-srt negative pacing offsets#1922
kixelated merged 1 commit into
mainfrom
codex/fix-srt-negative-pacing

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Summary

  • Fix moq-srt egress pacing so frames with presentation timestamps before the current media anchor pace before the anchor instead of collapsing onto it.
  • Keep the unavoidable startup/Instant underflow case panic-free by saturating only that boundary condition.
  • Add a regression assertion for a reordered B-frame whose PTS trails the re-anchored live edge.

Root Cause

pace() computed anchor + Duration::from(ts).saturating_sub(Duration::from(base)). When ts < base, that flattened the negative media offset to zero, so reordered frames could be stamped at the live edge instead of their earlier media instant.

Validation

  • cargo test -p moq-srt pace_re_anchors_to_live_edge
  • cargo check -p moq-srt
  • cargo fmt --package moq-srt
  • git diff --check

Refs #1917.

(Written by Codex)

Co-Authored-By: Codex <codex@openai.com>
@kixelated kixelated marked this pull request as ready for review June 26, 2026 19:03
@kixelated kixelated merged commit 72b2b25 into main Jun 26, 2026
1 check passed
@kixelated kixelated deleted the codex/fix-srt-negative-pacing branch June 26, 2026 19:03
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6ca3d158-2380-43db-9a60-9b4d6d21defc

📥 Commits

Reviewing files that changed from the base of the PR and between 86ff316 and 806e0db.

📒 Files selected for processing (1)
  • rs/moq-srt/src/server.rs

Walkthrough

pace now computes send_at with logic that can place it earlier than anchor when ts is before base. The test pace_re_anchors_to_live_edge adds a reordered-frame case that checks an earlier send_at while keeping the re-anchored base behavior unchanged.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch codex/fix-srt-negative-pacing

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant