From 3e28bd747843c220eb621007bbe60fa77f1cb607 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 10 Jan 2012 18:01:10 +0000 Subject: Fix compilation on old Jack without jack_port_type_get_buffer_size (fix ticket #801). git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@3932 a436a847-0d15-0410-975c-d299462d15a1 --- src/jalv.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/jalv.c') diff --git a/src/jalv.c b/src/jalv.c index e68b508..20e1fb3 100644 --- a/src/jalv.c +++ b/src/jalv.c @@ -297,8 +297,10 @@ jack_buffer_size_cb(jack_nframes_t nframes, void* data) { Jalv* const host = (Jalv*)data; host->buf_size_set = true; +#ifdef jack_port_type_get_buffer_size host->midi_buf_size = jack_port_type_get_buffer_size( host->jack_client, JACK_DEFAULT_MIDI_TYPE); +#endif jalv_allocate_port_buffers(host); return 0; } @@ -696,8 +698,14 @@ main(int argc, char** argv) if (!host.jack_client) die("Failed to connect to JACK.\n"); +#ifdef jack_port_type_get_buffer_size host.midi_buf_size = jack_port_type_get_buffer_size( host.jack_client, JACK_DEFAULT_MIDI_TYPE); +#else + host.midi_buf_size = 4096; + fprintf(stderr, "warning: Old JACK, using default MIDI buffer size %zu\n", + host.midi_buf_size); +#endif /* Instantiate the plugin */ host.instance = lilv_plugin_instantiate( -- cgit v1.2.1