diff --git a/src/xenia/apu/xma_context.cc b/src/xenia/apu/xma_context.cc index 4e280b941..18c9830fe 100644 --- a/src/xenia/apu/xma_context.cc +++ b/src/xenia/apu/xma_context.cc @@ -368,6 +368,13 @@ void XmaContext::Decode(XMA_CONTEXT_DATA* data) { current_input_buffer, data->output_buffer_ptr, data->output_buffer_block_count); + if (is_stream_done_) { + is_stream_done_ = false; + packets_skip_ = 0; + SwapInputBuffer(data); + return; + } + size_t input_buffer_0_size = data->input_buffer_0_packet_count * kBytesPerPacket; size_t input_buffer_1_size = @@ -414,13 +421,6 @@ void XmaContext::Decode(XMA_CONTEXT_DATA* data) { // Out of data. break; } - - if (is_stream_done_) { - is_stream_done_ = false; - packets_skip_ = 0; - SwapInputBuffer(data); - return; - } // Setup the input buffer if we are at loop_end. // The input buffer must not be swapped out until all loops are processed. reuse_input_buffer = TrySetupNextLoop(data, false);