From 79273f6099074315947e290a6bdc616b97a11377 Mon Sep 17 00:00:00 2001 From: ferreum Date: Thu, 17 Feb 2022 22:51:14 +0100 Subject: [PATCH] add options for seek speed factor and fast threshold --- demoseeking.cfg | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/demoseeking.cfg b/demoseeking.cfg index a70dd5d60..30c9d9f31 100644 --- a/demoseeking.cfg +++ b/demoseeking.cfg @@ -30,6 +30,17 @@ // much while seeking. If the framerate is still high while seeking, you // may increase this, but increasing this with low framerate is unlikely to // improve seek performance. +// _demoseeking_speed_factor +// Factor of remaining time to seek speed. Default 10. +// The seek speed is defined by the formula +// +// 1.0 + [remaining seek seconds] * _demoseeking_speed_factor +// +// bound by _demoseeking_min_speed and _demoseeking_max_speed. +// _demoseeking_fast_speed +// Seek speed above which rendering is disabled. Default 80. +// +// Type demoseeking_reset_options in the console to reset all options. // // Variables: // @@ -58,7 +69,8 @@ alias _demoseeking_init_vars1 "" _demoseeking_init_vars${_demoseeking_vars_loaded ?} // option initialization (persistent) -alias _demoseeking_init_options "seta _demoseeking_options_loaded 1; seta _demoseeking_min_speed 1.5; seta _demoseeking_max_speed 200" +alias demoseeking_reset_options "seta _demoseeking_options_loaded 1; seta _demoseeking_min_speed 1.5; seta _demoseeking_max_speed 200; seta _demoseeking_fast_speed 80; seta _demoseeking_speed_factor 10" +alias _demoseeking_init_options demoseeking_reset_options alias _demoseeking_init_options1 "" _demoseeking_init_options${_demoseeking_options_loaded ?} @@ -152,7 +164,7 @@ alias _seekdemo_check_continue_0 "_seekdemo_leave_seek; seekdemo_hook_seek_end" // - Adjust the playback speed by setting the slowmo cvar. The further the seek, the faster the playback speed. // - Compare the speed to different speed levels to maximize performance for long seeks while reducing screen flashes for short ones. // Then continue the loop with "defer 0", so the check is run on every rendered frame. -alias _seekdemo_check_continue_1 "set _seekdemo_speed_level failed; cl_cmd rpn _seekdemo_target time sub 10 mul _demoseeking_min_speed max _demoseeking_max_speed min dup /slowmo exch def dup 80 gt exch 2 gt add /_seekdemo_speed_level exch def; _seekdemo_set_options; defer 0 _seekdemo_check_time" +alias _seekdemo_check_continue_1 "set _seekdemo_speed_level failed; cl_cmd rpn _seekdemo_target time sub _demoseeking_speed_factor 0.01 max mul 1 add _demoseeking_min_speed max _demoseeking_max_speed min dup /slowmo exch def dup _demoseeking_fast_speed gt exch 2 gt add /_seekdemo_speed_level exch def; _seekdemo_set_options; defer 0 _seekdemo_check_time" alias _seekdemo_check_continue_failed "_seekdemo_failed \"(demo ended?)\"" alias _seekdemo_failed "_seekdemo_leave_seek; echo SEEK FAILED ${1 ?}" -- 2.39.2