diff options
author | David Robillard <d@drobilla.net> | 2012-03-20 04:35:05 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-03-20 04:35:05 +0000 |
commit | 3f2cc4091ed48e27b4d0ffbad68590b391605324 (patch) | |
tree | c4f79b711194f59d8f9b767c7530384f2e993ad8 | |
parent | 96050922420cb0c616b2bed81c8961ad7ab16a7e (diff) | |
download | jalv-3f2cc4091ed48e27b4d0ffbad68590b391605324.tar.gz jalv-3f2cc4091ed48e27b4d0ffbad68590b391605324.tar.bz2 jalv-3f2cc4091ed48e27b4d0ffbad68590b391605324.zip |
More gracefully handle plugin => UI message overflows.
git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@4083 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/jalv.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -472,8 +472,7 @@ jack_process_cb(jack_nframes_t nframes, void* data) i = lv2_evbuf_next(i)) { uint32_t frames, subframes, type, size; uint8_t* data; - lv2_evbuf_get(i, &frames, &subframes, - &type, &size, &data); + lv2_evbuf_get(i, &frames, &subframes, &type, &size, &data); assert(size > 0); // FIXME: check type jack_midi_event_write(buf, frames, data, size); @@ -488,6 +487,10 @@ jack_process_cb(jack_nframes_t nframes, void* data) LV2_Atom* atom = (LV2_Atom*)ev->body; atom->type = type; atom->size = size; + if (jack_ringbuffer_write_space(host->plugin_events) + < sizeof(buf) + size) { + break; + } jack_ringbuffer_write(host->plugin_events, buf, sizeof(buf)); /* TODO: race, ensure reader handles this correctly */ jack_ringbuffer_write(host->plugin_events, (void*)data, size); |