Repository navigation
Send a partial Object when the live input pauses - #58
Merged
mondain merged 2 commits intoNov 19, 2026
Merged
Conversation
readObject waited for a full Object with no time limit. When a live input stalled, the packets already read waited for it to resume and reached receivers late, after their playout time. * Publish the partial Object once its first packet has waited 50 ms and no further packet is available. * Wait with a timeout: poll() on a pipe or FIFO, and a new PacketQueueDevice::waitForReadyRead() for a program of a multiplex. A regular file never waits. * Open a source that is not a regular file unbuffered. A buffered QFile reads 16 KB at a time, and on a pipe the read waits for all of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Opened unbuffered, the pipe cost one read() per 188-octet packet and a poll() before each. A read now takes what the pipe holds, up to 64 KB, into the packetizer's own buffer, and poll() runs only while that buffer holds less than one packet. * Serve the bytes that open() peeked first, so the order holds. * Keep a partial trailing packet until the rest arrives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a live input paused, moq2ts kept the packets already read for the next Object and sent them only when the input resumed. Receivers then got those packets one pause late: a 2.5 s pause delayed up to 347 packets by 2.5 s.
moq2ts now sends the partial Object once its first packet has waited 50 ms. It also reads a pipe in chunks of up to 64 KB instead of waiting for 16 KB. Files work as before.
On a slow input, the rule also bounds the time to fill an Object. At 128 kb/s, an Object carries about 4 packets (computed).
I tested the change in November 2026. A new test checks that a quiet pipe and a quiet packet queue each give a partial Object after 50 ms. On a steady pipe, Objects stay full, and the CPU use matches main. All 21 unit tests pass.
This change is