Skip to content

Wait for the PAT and PMT of a live source in PCR time - #59

Merged
mondain merged 1 commit into
openmoq:mainfrom
gwendalsimon:fix/live-psi-window
Nov 19, 2026
Merged

mondain merged 1 commit into
openmoq:mainfrom
gwendalsimon:fix/live-psi-window

Conversation

@gwendalsimon

@gwendalsimon gwendalsimon commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

moq2ts waits for the PAT and PMT of a live source in PCR time instead of a packet count. The scan read 4096 packets, 154 ms at 40 Mbit/s. An encoder that sends a PAT every 476 ms, within TR 101 290's 500 ms, failed two of three starts with "No PAT found at the start of the source". The PMT scan had the same limit, so a track could open without its PCR PID.

A live source now waits up to 1 s of PCR time for the PAT, then up to 1 s more for its PMT. A program in a multiplex gets the same PMT wait. I capped the single-program live scan at 106,400 packets. Files keep the 4096-packet scan.

In November 2026, a new 40 Mbit/s test failed on main, and all 21 unit tests passed. I can change the bounds if you prefer.


This change is Reviewable

The PSI scan of a single-program live source read at most 4096
packets, which is 154 ms at 40 Mbit/s. An encoder that sends a PAT
every 476 ms, within the 500 ms of ETSI TR 101 290, then failed most
starts with "No PAT found at the start of the source".

* On a live source, wait for the PAT up to 1 s of PCR time
  (kPsiWindowPcr), then for its PMT up to 1 s after the PAT.
* Cap the single-program live scan, which keeps what it reads, at
  106,400 packets (2 s at 80 Mbit/s, about 20 MB). A source without
  a PCR stops at that cap.
* A program of a multiplex (timed windows) now also waits up to 1 s
  after the PAT for its PMT, where it stopped 1 s after the first PCR.
  Its 600,000-packet cap and stall error are unchanged.
* Keep the 4096-packet scan for seekable files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mondain
mondain merged commit e7504cb into openmoq:main Nov 19, 2026
4 checks passed
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.

2 participants