aboutsummaryrefslogtreecommitdiffstats
path: root/src/jalv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/jalv.c')
-rw-r--r--src/jalv.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/jalv.c b/src/jalv.c
index 25676c2..0e77239 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -1041,8 +1041,14 @@ main(int argc, char** argv)
options_feature.data = &options;
- /* Calculate theoretical UI update frequency. */
- jalv.ui_update_hz = (double)jalv.sample_rate / jalv.midi_buf_size * 2.0;
+ if (!jalv.opts.update_rate) {
+ /* Calculate theoretical UI update frequency. */
+ jalv.ui_update_hz = (double)jalv.sample_rate / jalv.midi_buf_size * 2.0;
+ jalv.ui_update_hz = MAX(25, jalv.ui_update_hz);
+ } else {
+ jalv.ui_update_hz = jalv.opts.update_rate;
+ jalv.ui_update_hz = MAX(1, jalv.ui_update_hz);
+ }
/* The UI can only go so fast, clamp to reasonable limits */
jalv.ui_update_hz = MIN(60, jalv.ui_update_hz);