From 23976e9b4410000a02b81f398a8a7f0e139fc8ad Mon Sep 17 00:00:00 2001 From: Joe Osborn Date: Thu, 2 Feb 2023 11:44:30 -0800 Subject: [PATCH] Fix bsv playback from a starting state for dosbox (#14939) This relaxes a warning about save state sizes for cores like dosbox-pure that don't report accurate save state sizes. Before, the warning would be issued and the state would not be loaded; now, the warning is issued and the state is loaded anyway. Co-authored-by: Joseph C. Osborn --- tasks/task_movie.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tasks/task_movie.c b/tasks/task_movie.c index 79edeb079b..acdefa01b9 100644 --- a/tasks/task_movie.c +++ b/tasks/task_movie.c @@ -105,16 +105,16 @@ static bool bsv_movie_init_playback( return false; } core_serialize_size( &info); - - if (info.size == state_size) + /* For cores like dosbox, the reported size is not always + correct. So we just give a warning if they don't match up. */ + serial_info.data_const = handle->state; + serial_info.size = state_size; + core_unserialize(&serial_info); + if (info.size != state_size) { - serial_info.data_const = handle->state; - serial_info.size = state_size; - core_unserialize(&serial_info); - } - else RARCH_WARN("%s\n", msg_hash_to_str(MSG_MOVIE_FORMAT_DIFFERENT_SERIALIZER_VERSION)); + } } handle->min_file_pos = sizeof(header) + state_size;