From dae508500a2b4a3804ebdcf7ce0617c1a6f5036f Mon Sep 17 00:00:00 2001 From: Gliniak Date: Thu, 3 Nov 2022 12:59:34 +0100 Subject: [PATCH] [APU] Clear remaining packets skip when we're done with current stream Plus some additional logging --- src/xenia/apu/xma_context.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/xenia/apu/xma_context.cc b/src/xenia/apu/xma_context.cc index cc6b80271..79d2bb49a 100644 --- a/src/xenia/apu/xma_context.cc +++ b/src/xenia/apu/xma_context.cc @@ -404,6 +404,7 @@ void XmaContext::Decode(XMA_CONTEXT_DATA* data) { if (is_stream_done_) { is_stream_done_ = false; + packets_skip_ = 0; SwapInputBuffer(data); return; } @@ -659,6 +660,12 @@ void XmaContext::Decode(XMA_CONTEXT_DATA* data) { offset = static_cast( GetNextFrame(current_input_buffer, current_input_size, offset)); + XELOGAPU( + "XmaContext {}: Next Offset: {} (Frame: {}/{} Packet: {}/{} Packet " + "Skip: {} - {})", + id(), offset, frame_idx, frame_count, packet_idx, + current_input_packet_count, xma::GetPacketSkipCount(packet), + data->input_buffer_read_offset); if (frame_idx + 1 >= frame_count) { // Skip to next packet (no split frame) packets_skip_ = xma::GetPacketSkipCount(packet) + 1;