Skip to content

import ts --passthrough ends at an unflagged clock step back; the media-aware import republishes since #7144 #8911

Closed

Description

@t0ms

Title: import ts --passthrough ends at an unflagged clock step back; the media-aware import republishes since #7144

At a source's unflagged step back, moq import ts republishes under a fresh epoch (#7144) and its subscribers follow with --stitch. moq import ts --passthrough still ends: passthrough.rs returns PcrRewind at any step back without the flag (main 8f8eec3886, the doc comment at line 104 and the match at line 536). Its subscribers lose the broadcast until a supervisor restarts the import.

Related. #7102 reported this step on a live contribution feed through the media-aware import, and was closed when the step-restart quest landed. #7144 is that fix. Its description lists the passthrough lane as not done: "--passthrough: the raw lane ends on PcrRewind/PcrRestart; a CLI supervisor could republish it too, but its errors carry no remainder." This issue is that item, with the passthrough lane's own evidence.

Seen twice on a live contribution feed whose upstream switched between two unlocked encodes, stepping back 16,845 s unflagged:

  • A 72 h CDN soak, one publishing host feeding both lanes (client d66c892833). The demultiplexed import logged the source's clock stepped; republishing and kept running. The passthrough import exited 1 with PCR on PID 111 went back from 44342272340 to 2166511883529 without a discontinuity_indicator, and all 16 of its subscribers' sessions ended. The wrapper restarted the import, and the subscribers reported output again 6.7–6.8 s later.
  • A 72 h shadow of the same feed against an SRT leg (cd560bde5e): the passthrough lane lacked 5.6 s of content at the step, which the SRT leg carried.

Ask: treat PcrRewind in the passthrough import as #7144 treats a step in the media-aware one: end the instance at the step and republish under a new epoch, so that a subscriber with --stitch follows it. The open point is the one #7144 names: its errors carry no remainder. Is there a way for the remainder to reach the new instance, or is a restart without it acceptable for the raw lane? Happy to test a branch on the same feed and our step fixtures (an unflagged step back and forward at a GOP boundary and mid-GOP).

(Written by Claude Opus 5.5)

Activity

  1. coderabbitai commented on Nov 16, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #7144 - feat(mux): a TS clock step restarts the import under a new epoch [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. t0ms commented on Nov 17, 2026

    @t0ms
    ContributorAuthor

    Before building a fix, I found something that changes the ask above. Which of these options would you take?

    Finding. Republishing alone would not keep passthrough subscribers. moq export ts --passthrough refuses --follow and --stitch (args.rs#L1338), and the Release it runs (subscribe.rs#L558) has no counterpart to Follower, so it ends with the old instance. The clock step itself is something the release already absorbs: its jitter buffer re-anchors on "a step with no marker at all, as a changeover between two encoders whose clocks disagree" (jitter.rs#L492), and the importer already adds an unflagged step forward to its timeline. Only the importer's refusal to count back ends the lane (passthrough.rs#L531-L537).

    Options.

    1. Splice in place. At a step back, keep the instance and continue the timeline at the rate before the step, as the flagged forward jump does (passthrough.rs#L541). Every byte stays on the track, so the output carries the change as the input did, as an SRT receiver's would, and subscribers need no change. Small, moq-mux only. It goes against the doc comment's "a signalled restart is new content and needs a new broadcast" (passthrough.rs#L100-L108), which is why I am asking.
    2. Republish on both sides, as this issue asked. Passthrough returns the step with its remainder, the CLI republishes under a new instance as ts::Republish does, and Release learns to follow a replacement: --follow and --stitch for export ts --passthrough, by generalising Follower over Release or by a passthrough twin of it. Large, moq-mux and moq-cli. The new instance drops the input from the step until the new source's PAT, PMT and next random access point, as the media-aware lane does (republish.rs#L21-L22).
    3. Republish on the publisher only. The import stays up across the step, but subscribers still end at it until something restarts them. Medium. It removes the publisher's restart but not the session loss this issue reports.

    A flagged step back (PcrRestart) is a second choice under option 1: splice it too, behind a break marker as a flagged forward jump is, or keep it ending the import as now.

    I would take option 1 for both, since the passthrough's timestamps only pace the release and its promise is byte-identical carriage, but the rule is yours to relax. Once you choose, I will open a PR with a test that fails on main, and validate it on the same feed.

    (Written by Claude Opus 5.5)

  3. added
    questBeing tracked/planned in a quest. See `quest/`
    on Nov 17, 2026
  4. kixelated commented on Nov 18, 2026

    @kixelated
    Collaborator

    @t0ms #9069 is ready to try: moq import ts --passthrough no longer ends the broadcast at a clock step. A step back, or an unflagged jump forward of more than 10 s, now continues the timestamps behind a break marker, and the bytes still pass through unchanged. Could you run its branch on your real feed and report back here or on the PR? It lands once you confirm.

    (Written by Claude Opus 5.5 with high)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questBeing tracked/planned in a quest. See `quest/`

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions