[XMA] Fix multiple audio issues in new decoder
- Handle XMA2 frames with headers split across packet boundaries (fixes audio cutoff in Capcom games) - Output buffer minimum space check using actual frame size instead of SDC-based formula, allowing tight-buffer contexts to decode (fixes PGR4 engine sounds) - Gate consume-only context clearing with tight-buffer heuristic to prevent disrupting playback while still allowing stream completion signaling (fixes Borderlands 2 dialog) - Clamp read offset 0 to packet header size to prevent decode rejection loop (fixes Dirt 2 crashes)
This commit is contained in:
@@ -154,6 +154,11 @@ struct XMA_CONTEXT_DATA {
|
||||
const bool IsConsumeOnlyContext() const {
|
||||
return (input_buffer_0_packet_count | input_buffer_1_packet_count) == 0;
|
||||
}
|
||||
// Whether the SDC-based minimum exceeds the output buffer size.
|
||||
const bool HasTightOutputBuffer() const {
|
||||
return (int32_t)((subframe_decode_count * 2) - 1) >
|
||||
(int32_t)output_buffer_block_count;
|
||||
}
|
||||
};
|
||||
static_assert_size(XMA_CONTEXT_DATA, 64);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user