diff --git a/input/bsv/bsvmovie.c b/input/bsv/bsvmovie.c index c728f4e65e04..29804fff7b2c 100644 --- a/input/bsv/bsvmovie.c +++ b/input/bsv/bsvmovie.c @@ -1677,12 +1677,15 @@ bool bsv_movie_peek_frame_info(bsv_movie_t *movie, uint8_t *token, uint64_t *len bool movie_find_checkpoint_before(bsv_movie_t *movie, int64_t frame, bool consider_paused, int64_t *cp_pos_out, int64_t *cp_frame_out) { - /* skip to prev needs to go back at least 60 frames if rewinding when not paused */ runloop_state_t *runloop_st = runloop_state_get_ptr(); bool paused = !!(runloop_st->flags & RUNLOOP_FLAG_PAUSED) || consider_paused; - const int64_t prev_skip_min_distance = 60; + /* skip to prev would prefer to go back at least 30 frames if + rewinding when not paused, but won't skip over more than one + checkpoint while going backwards. */ + const int64_t prev_skip_min_distance = 30; int64_t target_frame = frame, cur_frame = 0; int64_t initial_pos, cp_pos=-1, cp_frame=-1; + int64_t maybe_last_frame = -1, maybe_last_pos = -1; uint64_t frame_len; uint8_t tok; if (!movie || movie->version == 0) @@ -1702,6 +1705,16 @@ bool movie_find_checkpoint_before(bsv_movie_t *movie, int64_t frame, bool consid cp_pos = intfstream_tell(movie->file); cp_frame = cur_frame; } + else + { + if (maybe_last_pos > 0) + { + cp_pos = maybe_last_pos; + cp_frame = maybe_last_frame; + } + maybe_last_pos = intfstream_tell(movie->file); + maybe_last_frame = cur_frame; + } } cur_frame += 1; intfstream_seek(movie->file, frame_len, SEEK_CUR); diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 5f731aa093f2..3f11b19ee60f 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -11602,10 +11602,12 @@ static bool setting_append_list( parent_group, general_write_handler, general_read_handler); - (*list)[list_info->index - 1].action_ok = &setting_action_ok_uint_special; + (*list)[list_info->index - 1].action_ok = &setting_action_ok_uint; (*list)[list_info->index - 1].get_string_representation = &setting_get_string_representation_uint_replay_checkpoint_interval; - menu_settings_list_current_add_range(list, list_info, 0, 3600, 60, true, true); + menu_settings_list_current_add_range(list, list_info, 0, 0, 1, true, false); + SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_CMD_APPLY_AUTO); + CONFIG_BOOL( list, list_info,