From 1b808ae2d23f4abb8251d69b5fe555cc6923a566 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 10 Aug 2022 05:32:03 -0400 Subject: Remove lilv dependency from worker.h and worker.c --- src/jalv.c | 5 +++-- src/worker.c | 7 +++---- src/worker.h | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/jalv.c b/src/jalv.c index e5f777f..66d4407 100644 --- a/src/jalv.c +++ b/src/jalv.c @@ -644,8 +644,9 @@ jalv_run(Jalv* jalv, uint32_t nframes) lilv_instance_run(jalv->instance, nframes); // Process any worker replies - jalv_worker_emit_responses(&jalv->state_worker, jalv->instance); - jalv_worker_emit_responses(&jalv->worker, jalv->instance); + LV2_Handle handle = lilv_instance_get_handle(jalv->instance); + jalv_worker_emit_responses(&jalv->state_worker, handle); + jalv_worker_emit_responses(&jalv->worker, handle); // Notify the plugin the run() cycle is finished if (jalv->worker.iface && jalv->worker.iface->end_run) { diff --git a/src/worker.c b/src/worker.c index 2abf363..2db0992 100644 --- a/src/worker.c +++ b/src/worker.c @@ -3,6 +3,7 @@ #include "worker.h" +#include "lv2/core/lv2.h" #include "lv2/worker/worker.h" #include "zix/ring.h" #include "zix/sem.h" @@ -115,18 +116,16 @@ jalv_worker_schedule(LV2_Worker_Schedule_Handle handle, } void -jalv_worker_emit_responses(JalvWorker* worker, LilvInstance* instance) +jalv_worker_emit_responses(JalvWorker* worker, LV2_Handle lv2_handle) { if (worker->responses) { uint32_t read_space = zix_ring_read_space(worker->responses); while (read_space) { uint32_t size = 0; zix_ring_read(worker->responses, (char*)&size, sizeof(size)); - zix_ring_read(worker->responses, (char*)worker->response, size); - worker->iface->work_response( - instance->lv2_handle, size, worker->response); + worker->iface->work_response(lv2_handle, size, worker->response); read_space -= sizeof(size) + size; } diff --git a/src/worker.h b/src/worker.h index 606278f..b64fb46 100644 --- a/src/worker.h +++ b/src/worker.h @@ -8,7 +8,6 @@ #include "zix/sem.h" #include "zix/thread.h" -#include "lilv/lilv.h" #include "lv2/core/lv2.h" #include "lv2/worker/worker.h" @@ -51,7 +50,7 @@ jalv_worker_schedule(LV2_Worker_Schedule_Handle handle, const void* data); void -jalv_worker_emit_responses(JalvWorker* worker, LilvInstance* instance); +jalv_worker_emit_responses(JalvWorker* worker, LV2_Handle lv2_handle); #ifdef __cplusplus } // extern "C" -- cgit v1.2.1