[XMA] Clear host data on context clear + swap buffer if decoding fails

This commit is contained in:
Gliniak 2023-01-06 19:27:41 +01:00
parent 668244adb7
commit d24d3295c6
1 changed files with 7 additions and 0 deletions

View File

@ -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
}