From d24d3295c69388ef6c465cd69d73431027019a4c Mon Sep 17 00:00:00 2001 From: Gliniak Date: Fri, 6 Jan 2023 19:27:41 +0100 Subject: [PATCH] [XMA] Clear host data on context clear + swap buffer if decoding fails --- 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 18c9830fe..a619e8b31 100644 --- a/src/xenia/apu/xma_context.cc +++ b/src/xenia/apu/xma_context.cc @@ -147,9 +147,15 @@ void XmaContext::Clear() { data.input_buffer_1_valid = 0; data.output_buffer_valid = 0; + data.input_buffer_read_offset = 0; data.output_buffer_read_offset = 0; data.output_buffer_write_offset = 0; + xma_frame_.fill(0); + split_frame_len_ = 0; + split_frame_len_partial_ = 0; + split_frame_padding_start_ = 0; + data.Store(context_ptr); } @@ -658,6 +664,7 @@ void XmaContext::Decode(XMA_CONTEXT_DATA* data) { XELOGE("XmaContext {}: Error - Decoding failed", id()); data->parser_error_status = 4; // TODO(Gliniak): Find all parsing errors // and create enumerator from them + SwapInputBuffer(data); assert_always(); return; // TODO bail out }