Repository navigation
fix(video): trim orphan leading pictures after delivery breaks #5666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f34e18e
chore: claim leading-picture recovery quest
kixelated e955cc3
fix(video): trim orphan leading pictures after delivery breaks
kixelated 45d6b39
chore: complete leading-picture recovery quest
kixelated fa1093d
Merge remote-tracking branch 'origin/main' into pr-5666
kixelated fc42ecf
Merge remote-tracking branch 'origin/main' into merge-5666
kixelated 940d434
fix(video): trim leading pictures after local drops too
kixelated File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import type { Micro } from "@moq/clock"; | ||
| import type { Container } from "@moq/hang"; | ||
|
|
||
| /** Refuse leading pictures whose previous GOP was not delivered to this decoder. @internal */ | ||
| export class Recovery { | ||
| #needed = true; | ||
| #floor?: Micro; | ||
|
|
||
| /** Arm recovery after media was lost, preserving continuous groups and declared ends. */ | ||
| gap(): void { | ||
| this.#needed = true; | ||
| } | ||
|
|
||
| /** Whether this access unit has the references available at the current delivery boundary. */ | ||
| accept(frame: Container.ReceivedFrame): boolean { | ||
| if (frame.keyframe) { | ||
| this.#floor = this.#needed ? frame.timestamp : undefined; | ||
| this.#needed = false; | ||
| } | ||
| return this.#floor === undefined || frame.timestamp >= this.#floor; | ||
| } | ||
| } | ||
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
This file was deleted.
Oops, something went wrong.
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a join or gap resumes on an
Endmarker group, the container may legally yield the stopped encoder's final delta packets before the next fresh group. Here#neededis true but#flooris still undefined, so those packets are accepted and submitted without their skipped references, recreating the decode failure this change is intended to prevent. Keep refusing frames while recovery is needed until a keyframe establishes the floor. (Written by GPT-5.6 Sol)Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not changing this; the guard would never fire. Both containers force the first media frame of every group to a keyframe, a marker included (
js/hang/src/container/consumer.tssetskeyframewhen!marker && index === 0, and Rust'sconsumer.rsdoesframe.keyframe || self.index == 0with markers not counted). So the first drain packet after anEndarrives flagged as a keyframe and clears#neededbefore any delta is seen. Also, neither publisher writes frames after a video marker: both close the marker group at once. If a video drain after a marker ever becomes real, the fix belongs in the containers' keyframe inference, not here.(Written by Claude Opus 5.5)