Repository navigation
H.264: bound frame_num gap work and reject gaps the SPS forbids (#427) - #465
Merged
Merged
Conversation
h-a-n-a-s-h-i
pushed a commit
that referenced
this pull request
Oct 14, 2026
- #178: ToUnicode ranges looked up without indexing - #465: frame_num gaps are concealed (bounded) even when the SPS forbids them; cut streams keep playing - #471: control request lines up to 256 MB so picture/media inserts still fit - #473: a merge that loses its only row or column is removed, with regression tests - #521: AutoCorrect no longer rewrites real words (cant, wont, im) - #654: inherit_placeholder_geometry's doc comment back on its function Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Thank you for this contribution, @NikitkaRa! It has landed on If you haven't already, please come join us on Discord: https://discord.gg/artcraft |
anishguduru
pushed a commit
to anishguduru/deckcraft
that referenced
this pull request
Oct 16, 2026
* Print: Windows lists its printers and spools jobs (storytold#756) The Print dialog's printer list comes from Win32_Printer through PowerShell's CIM (wmic is gone from Windows 11), and jobs are spooled by the embedded windows_print.ps1: the in-box Windows.Data.Pdf renders each sheet at the printer's own resolution and System.Drawing.Printing carries copies, collation, duplex and colour as the job's settings. Both run through powershell, so the Rust code touches no Win32 API. Fixes storytold#756, with the printer-not-showing duplicates storytold#160, storytold#244, storytold#293, storytold#465 and storytold#644; CIM approach from storytold#452. On CI a paused Generic / Text Only test printer catches the job in its queue; a parser test keeps the script valid PowerShell. * Print: fix the Windows await helper and render the job on CI (dry run) Real-machine testing found [System.WindowsRuntimeSystemExtensions]::GetMethods() failing with 'does not contain a method named GetMethods': GetMethods is an instance method of [Type], so it is called with '.', the form the canonical WinRT-await snippets use, not '::'. The first CI run missed it because the end-to-end test skipped silently when the runner refused the test printer, so the script had never actually run. The script now honours PDFCRAFT_PRINT_DRYRUN=1: render every sheet with Windows.Data.Pdf to PNGs in the temporary folder and print nothing. The test runs that half unconditionally, so CI exercises the whole WinRT path — projection, await helpers, render — on any machine, while the paused-printer half stays best-effort and prints why it skipped. Win32_Printer enumeration asks only for Name and Default, so a machine with nine printers waits less. * Tests: the find-options wait in the viewer test is a deadline too 4280f83 converted the frame-count waits in this test to deadlines after the same 12-of-15 race under a full workspace test run, but left the first wait — the one for the 'page' matches — on the old 60-frame loop, and it flaked the same way on PR storytold#847's CI. Same fix: wait up to 20 s for the 15 matches, then assert.
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.
Closes #427.
What was wrong.
Dpb::fill_frame_num_gap(crates/h264/src/dpb.rs) inserted one "non-existing" frame per missingframe_num, and the decoder callback allocated and copied a full picture for each one. Withlog2_max_frame_num = 16, one small slice could set off ~65 535 full-frame allocations and copies.gaps_in_frame_num_value_allowed_flagwas parsed but this path never checked it.Fix.
gaps_in_frame_num_allowed = 0,start_picturenow returns an error for a picture with aframe_numgap, so it no longer fills the gap (7.4.2.1.1 / 8.2.5.2).max_num_ref_framesshort-term references (≤ 16). When the gap is longer than that, inserting the whole gap would push out every earlier short-term reference and every non-existing frame except the lastmax_num_ref_frames. So the earlier short-term references are now marked unused up front, and only the tail of the gap is built as frames. The POC state (update_gap_frame) still walks every missingframe_numin order, soFrameNumOffsetwraparound comes out the same. Long-term references are left alone, as before.Tests.
dpb.rsunit tests: a 65 533-frame gap builds only 4 frames, walks the POC state over every missing number, and leaves exactly the last 4 non-existing frames as references. Also covered: a gap that wraps aroundMaxFrameNum, a short gap that keeps earlier references, and a huge gap with a long-term reference.synth_tests.rs: tiny CAVLC streams with aframe_numgap. When the SPS forbids gaps, the error is reported and the gap is not filled. When it allows them, the gap is filled and both pictures are output.pcm_long_term_mmco_gaps_*bit-exact tests still pass.cargo xtask ciis green: fmt, clippy-D warnings, tests, assets, layers, wasm.