Repository navigation
Port upstream #96: the frame after an XMA continuation starts in the next packet that has frames - #34
Merged
DesertGamer merged 1 commit intoNov 25, 2026
Conversation
… frames A frame that ends in a packet where no frame begins (the tail of a frame that crossed packets, then padding) left the next frame pointing into that padding, which ended the stream early. Now the next frame is found by following each packet's skip to the next packet with frames. (cherry picked from commit ba42db6)
2 of 23 tasks
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.
What this changes
This ports Marvisak/VIctory#96 by tedin7. It is cherry-picked with
-x, so the commit keeps their authorship.next_frameincrates/viport-formats/src/xma.rsmishandles a frame that runs through a packet with no frame start (a full continuation) and ends inside another such packet, which then holds only padding. It points the next frame into that padding instead of at the next packet that has frames. The reader then decodes padding, or the stream ends early, so the rest of the sound is dropped.The fix: when the frame ends in a packet with
frames == 0, follow each packet's skip until a packet with frames is reached.VIPort has the upstream merge of #96 in its history, but the change is not in the tree. It was lost in a later merge.
The only conflict was in the test module. VIPort's spanning-frame tests are kept, and #96's test follows them.
Checked
docs/asset-policy.md(the test builds its packets by hand)build.rs, git hook,.cargoconfig, CI change or script (or an issue explains why)cargo test --workspacepasses (onlyviport-formatson Linux, see below)cargo clippy --workspace --all-targets --locked -- -D warningspasses (forviport-formats)rustfmt; I did not reformat lines I did not changeWhat I ran
On Linux, Rust 1.98.1:
cargo test -p viport-formats --locked: 42 passed, 0 failed, 6 ignored.the_frame_after_continuation_packets_starts_in_the_next_packet_with_frameswithnext_frameas onmainfails withleft: Some(32864)(inside the padding of packet 2),right: Some(49184)(the first frame of packet 3).cargo clippy -p viport-formats --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings: clean.Not run: real XMA streams. They are game data and stay out of the repository.
Overlaps
#24 (upstream #183, XMA frame end) also edits
xma.rs:decodeand the test module. I merged the two branches locally and they merge cleanly.🤖 Generated with Claude Code