From cf0d65e9751ba4d49590ee7ceec5532ad3e123cb Mon Sep 17 00:00:00 2001 From: "Herman S." <429230+has207@users.noreply.github.com> Date: Sun, 22 Feb 2026 15:26:22 +0900 Subject: [PATCH] [XMA] Restore error_status on split frame body Fixes severe regressions in SCDA, we keep buffer swap for split header as that is required for audio loss in RE0. Original fix targeted RE0 but was too broad, only split header needed the swapbuffer consume change. --- src/xenia/apu/xma_context_new.cc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/xenia/apu/xma_context_new.cc b/src/xenia/apu/xma_context_new.cc index 1289777aa..5276bac1f 100644 --- a/src/xenia/apu/xma_context_new.cc +++ b/src/xenia/apu/xma_context_new.cc @@ -463,8 +463,6 @@ void XmaContextNew::Decode(XMA_CONTEXT_DATA* data) { if (!next_packet) { // Next buffer not available yet. We can't resolve the split header // without it, so consume (swap) the current buffer and move on. - // This loses one frame but avoids a deadlock where the game waits - // for us to finish this buffer before providing the next one. XELOGAPU( "XmaContext {}: Split frame header at packet {}, next buffer " "unavailable — swapping input buffer", @@ -514,13 +512,10 @@ void XmaContextNew::Decode(XMA_CONTEXT_DATA* data) { GetNextPacket(data, next_packet_index, current_input_packet_count); if (!next_packet) { - // Next buffer not available yet. We can't decode the split frame - // without it, so consume (swap) the current buffer and move on. - XELOGAPU( - "XmaContext {}: Split frame body at packet {}, next buffer " - "unavailable — swapping input buffer (need packet {}/{})", - id(), packet_index, next_packet_index, current_input_packet_count); - SwapInputBuffer(data); + // Error path + // Decoder probably should return error here + // Not sure what error code should be returned + data->error_status = 4; return; } // Copy next packet to buffer