Repository navigation
fix: keep all objects of a PGS multi-object display set; per-cue forced flag (#146) - #153
Merged
superuser404notfound merged 1 commit intoJul 19, 2026
Conversation
…ed flag (#146) A PGS display set can carry multiple composition objects at one start PTS (forced sign + dialogue, a common real-disc shape). The decoder correctly fans N objects into N same-start image cues, but two layers then collapsed them onto a single object: - The retained store's same-start image replacement assumed "a PGS composition has a unique start PTS", true per composition, false per composition OBJECT. The replacement key now includes object geometry (normalized position + pixel size, both deterministic across re-decodes via the alpha-bounding-box crop): a re-decode still replaces its placeholder twin, sibling objects are all kept, mirroring the text path's distinct-simultaneous-speakers rule. - The reconstruction pass held a SINGLE candidate cue, so a multi-object landing set lost all but one object at seek time. The candidate is now the whole same-start group; the #143 clear-trim applies per member. API half: AVSubtitleRect's AV_SUBTITLE_FLAG_FORCED was never read, so a host could not tell a forced sign from dialogue. It now lands in SubtitleImage.isForced and surfaces per cue as SubtitleCue.isForced (source-compatible additions; track-level TrackInfo.isForced unchanged). Covered by Issue146PGSMultiObjectTests (9 cases; the three collapse repros fail on main). Reported by cmcpherson274 (#146). Co-Authored-By: Claude <[email protected]>
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.
Fixes #146.
Problem
A PGS display set can carry multiple composition objects at the same start PTS (a forced sign at the top plus dialogue at the bottom, a common real-disc shape). The decoder correctly fans N objects into N same-start image cues, but two layers then collapsed them onto a single object, silently dropping the sibling(s):
insertCueSorted): the same-start image replacement assumed "a PGS composition has a unique start PTS". True per composition, false per composition object.PGSStaleArrivalGate): the pass held a single candidate cue, so a multi-object landing set lost all but one object at seek time.There was also no per-cue forced flag anywhere on the engine surface (
AVSubtitleRect.flags/AV_SUBTITLE_FLAG_FORCEDwas never read; only track-levelTrackInfo.isForcedexists), so a host could not even tell which line was dropped.Fix
SubtitleImage.isForced(from the rect'sAV_SUBTITLE_FLAG_FORCED) andSubtitleCue.isForcedare new source-compatible API.Tests
Issue146PGSMultiObjectTests, 9 cases with the reporter's geometry (sign [685,110,550,59] + dialogue [685,910,550,59] @1080p). The three collapse repros fail on main (store keeps 1 of 2 siblings; gate emits [1, 3] instead of [1, 2, 3]). 756 tests green, strict-concurrency=complete clean, tvOS Simulator build green.🤖 Generated with Claude Code
https://claude.ai/code/session_01NAPCg4tCDdSqkK6tPkNptw