From e00feb7b0f3045bfc3809bba1066d9850c52dd69 Mon Sep 17 00:00:00 2001 From: Gliniak Date: Tue, 13 Dec 2022 21:47:35 +0100 Subject: [PATCH] [APU] Fixed incorrect frame count + removed hopefully useless check from now --- src/xenia/apu/xma_context.cc | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/xenia/apu/xma_context.cc b/src/xenia/apu/xma_context.cc index 4c634700d..16cf9f432 100644 --- a/src/xenia/apu/xma_context.cc +++ b/src/xenia/apu/xma_context.cc @@ -509,17 +509,6 @@ void XmaContext::Decode(XMA_CONTEXT_DATA* data) { // split_frame_len_ - split_frame_len_partial_); } - if (split_frame_len_partial_ > split_frame_len_) { - XELOGAPU( - "XmaContext {}: Error - Invalid split frame lengths! " - "frame_length: {} " - "partial_length: {}", - id(), split_frame_len_, split_frame_len_partial_); - split_frame_len_ = 0; - split_frame_len_partial_ = 0; - SwapInputBuffer(data); - return; - } auto offset = stream.Copy( xma_frame_.data() + 1 + ((split_frame_len_partial_ + split_frame_padding_start_) / 8), @@ -894,11 +883,11 @@ std::tuple XmaContext::GetPacketFrameCount(uint8_t* packet) { int frame_count = 0; while (true) { - frame_count++; if (stream.BitsRemaining() < 15) { - return {frame_count, true}; + return {frame_count, false}; } + frame_count++; uint64_t size = stream.Read(15); if ((size - 15) > stream.BitsRemaining()) { return {frame_count, true};