Repository navigation
Opus: only take MFT output types with the decoder's channel count, cap stream-change retries - #926
DavidM1911 wants to merge 1 commit into
Conversation
…p stream-change retries configure_output accepted the first PCM16/Float32 type regardless of MF_MT_AUDIO_NUM_CHANNELS and then overwrote self.channels, so a multistream interleave could index past the buffer; drain_output retried MF_E_TRANSFORM_STREAM_CHANGE forever. Output types whose channel count differs from the decoder's are now skipped, and more than 4 stream changes is an error.
|
Linux / AMD RDNA3 datapoint. Merged state: head Full suite, Not tested: retail titles (none here), Windows, RDNA4. Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting. |
|
Two contributors checked independently and found that #503 solves the same problem (for #327) in a different way: #1607, group D12. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table. |
|
merge-check claim |
|
merge-check |
|
merge-check
|
|
#503 contains the same two changes in opus.rs (skip MFT output types whose channel count is not Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
Part of #327 (item 3).
Two guards on the Media Foundation MFT path in
crates/xcl/src/hle/opus.rs:MftDecoder::configure_outputaccepted the first PCM16/Float32 output type without checkingMF_MT_AUDIO_NUM_CHANNELSagainst the decoder's channel count, then overwroteself.channels— a multistream interleave sized for the expected count could index past the buffer if the MFT enumerated a different count first. Output types whose channel count differs are now skipped; a missingNUM_CHANNELSstill defaults to the decoder's count as before.MftDecoder::drain_outputretriedMF_E_TRANSFORM_STREAM_CHANGEin an unbounded loop; it now gives up after 4 reconfigurations.What is in it
crates/xcl/src/hle/opus.rsonly. No new unit test: both paths need a liveIMFTransform, which the crate's tests do not mock; the existing Opus/MFT tests still pass.Tested
x86_64-pc-windows-msvc:cargo test -p xcl --lib opus: 15 passed, 0 failedcargo test --workspace -- --test-threads=4: 676 passed, 0 failed, 41 ignoredscripts/smoke.ps1 -Seconds 60,cargo build --release -p xcl:main
a6f5f7a(same baseline as the sibling PRs; upstream/main is now2997c9a, docs-only on top):this PR's head
8d0176d:Not tested
AI use