aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-06-08 21:40:33 +0000
committerDavid Robillard <d@drobilla.net>2013-06-08 21:40:33 +0000
commit4b5ca743e944aaea9fa126cb4d2d131bf7c9a0b6 (patch)
treebe21dd585ca548bc15945b7846c5a2725b030313
parent2990d5048d09a9d2c7c96192b7850a79897dccc3 (diff)
downloadjalv-4b5ca743e944aaea9fa126cb4d2d131bf7c9a0b6.tar.gz
jalv-4b5ca743e944aaea9fa126cb4d2d131bf7c9a0b6.tar.bz2
jalv-4b5ca743e944aaea9fa126cb4d2d131bf7c9a0b6.zip
Resize ring according to rsz:minimumSize.
git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@5127 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/jalv.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/jalv.c b/src/jalv.c
index dae9582..f3a7f72 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -85,6 +85,13 @@
# define REALTIME
#endif
+/* Size factor for UI ring buffers. The ring size is a few times the size of
+ an event output to give the UI a chance to keep up. Experiments with Ingen,
+ which can highly saturate its event output, led me to this value. It
+ really ought to be enough for anybody(TM).
+*/
+#define N_BUFFER_CYCLES 16
+
ZixSem exit_sem; /**< Exit semaphore */
static LV2_URID
@@ -236,6 +243,8 @@ create_port(Jalv* jalv,
jalv->plugin, port->lilv_port, jalv->nodes.rsz_minimumSize);
if (min_size && lilv_node_is_int(min_size)) {
port->buf_size = lilv_node_as_int(min_size);
+ jalv->opts.buffer_size = MAX(
+ jalv->opts.buffer_size, port->buf_size * N_BUFFER_CYCLES);
}
lilv_node_free(min_size);
@@ -1034,7 +1043,7 @@ main(int argc, char** argv)
should be able to keep up with 4 cycles, and tests show this works
for me, but this value might need increasing to avoid overflows.
*/
- jalv.opts.buffer_size = jalv.midi_buf_size * 4;
+ jalv.opts.buffer_size = jalv.midi_buf_size * N_BUFFER_CYCLES;
}
if (jalv.opts.update_rate == 0.0) {