Repository navigation
Conversation
…nition The sub stored a new flow definition on its output the moment it arrived, while the subpictures in its schedule keep being output long after: pages decode ahead of their pts, so the pixels of the on-screen page went downstream under the flow definition of the next one. This was harmless while all subpictures of a flow had the same dimensions, but with the pic size and padding attributes changing per subpicture, downstream rescaled the current page to the geometry of the next page for the whole decode-ahead window, stretching it and putting it in the wrong place. Pair each buffered subpicture with the flow definition it was received under, and store that on the output when the subpicture starts being output. The output helper deduplicates identical flow definitions, so flows with constant dimensions behave as before.
The replacement rule was gated on teletext, so a dvb subtitle uref stayed in the list until it outlived its duration, which is the page timeout - up to 255 seconds. Every uref in the list whose window covers the frame's date is output again for every frame, so the per-frame work grew with the backlog, and once the pipeline stalled it never recovered: a repeated frame carries the same date, so nothing ever elapsed, while decoded pages kept arriving. A dvb subtitle display set carries the whole page, exactly like a teletext page, so the next subpicture replaces the previous one there too. Apply the replacement rule unconditionally, which bounds the list to the active subpicture plus whatever is still in advance. With each subpicture output under its own flow definition, overlapping subpictures also made the flow definition stored on the output switch back and forth on every frame.
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.
upipe_subpic_schedule stored a new flow definition on its sub output as soon as it arrived, while the subpictures already in the schedule keep being output until their pts comes round. Subtitle pages are decoded ahead of their pts, so the on-screen page went downstream under the flow definition of the next one.
That was harmless while every subpicture of a flow had the same size, but once the pic size and padding change per subpicture (as with #1272, which crops subtitles to their visible pixels), downstream rescales the current page to the geometry of the next one for the whole decode-ahead window.
Each buffered subpicture now keeps the flow definition it was received under, and that one is stored on the output when the subpicture is output. The output helper deduplicates identical flow definitions, so flows with a constant geometry behave as before. The same commit is also part of #1242.
Checked by driving the pipe with page 1 (hsize 100) at 10 s and page 2 (hsize 200) decoded ahead for 15 s: master outputs page 1 under hsize 200 from 11 s on, this branch under hsize 100, for both DVB and teletext flows. Builds without warnings