aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2018-03-31 13:33:37 +0200
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2018-03-31 13:33:37 +0200
commitefe0e2813a23ee5a90dfd4293ee89bb48169e407 (patch)
tree4a9a585ce15baabbc1ad801a3822d0402486a030
parent48b1969eb21b60b21a6f3c0e0be989ac8abc1dcb (diff)
downloadsynthpod-efe0e2813a23ee5a90dfd4293ee89bb48169e407.zip
synthpod-efe0e2813a23ee5a90dfd4293ee89bb48169e407.tar.gz
synthpod-efe0e2813a23ee5a90dfd4293ee89bb48169e407.tar.bz2
synthpod-efe0e2813a23ee5a90dfd4293ee89bb48169e407.tar.xz
app: fix bug in idisp.
-rw-r--r--VERSION2
-rw-r--r--app/synthpod_app.c20
-rw-r--r--app/synthpod_app_mod.c5
3 files changed, 17 insertions, 10 deletions
diff --git a/VERSION b/VERSION
index 32cedb0..d04e76d 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.5595
+0.1.5597
diff --git a/app/synthpod_app.c b/app/synthpod_app.c
index ca323b0..f884391 100644
--- a/app/synthpod_app.c
+++ b/app/synthpod_app.c
@@ -772,7 +772,7 @@ _sp_app_process_single_post(mod_t *mod, uint32_t nsamples, bool sparse_update_ti
if(mod->idisp.iface)
{
// trylock
- if(atomic_flag_test_and_set(&mod->idisp.lock))
+ if(!atomic_flag_test_and_set(&mod->idisp.lock))
{
const LV2_Inline_Display_Image_Surface *surf= mod->idisp.surf;
if(surf)
@@ -793,15 +793,23 @@ _sp_app_process_single_post(mod_t *mod, uint32_t nsamples, bool sparse_update_ti
ref = lv2_atom_forge_int(&app->forge, surf->height);
if(ref)
ref = lv2_atom_forge_vector_head(&app->forge, &frame[2], sizeof(int32_t), app->forge.Int);
- for(int h = 0; h < surf->height; h++)
+ if(surf->stride == surf->width * sizeof(uint32_t))
{
- const uint8_t *row = &surf->data[surf->stride * h];
+ if(ref)
+ ref = lv2_atom_forge_write(&app->forge, surf->data, surf->height * surf->stride);
+ }
+ else
+ {
+ for(int h = 0; h < surf->height; h++)
+ {
+ const uint8_t *row = &surf->data[surf->stride * h];
+ if(ref)
+ ref = lv2_atom_forge_raw(&app->forge, row, surf->width * sizeof(uint32_t));
+ }
if(ref)
- ref = lv2_atom_forge_raw(&app->forge, row, surf->width * sizeof(uint32_t));
+ lv2_atom_forge_pad(&app->forge, surf->height * surf->width * sizeof(uint32_t));
}
- if(ref)
- lv2_atom_forge_pad(&app->forge, surf->height * surf->width * sizeof(uint32_t));
if(ref)
synthpod_patcher_pop(&app->forge, frame, 3);
diff --git a/app/synthpod_app_mod.c b/app/synthpod_app_mod.c
index 565d2c1..4de6c0d 100644
--- a/app/synthpod_app_mod.c
+++ b/app/synthpod_app_mod.c
@@ -537,7 +537,7 @@ _mod_worker_thread(void *data)
varchunk_read_advance(mod_worker->state_to_worker);
}
- if(mod->idisp.iface)
+ if(mod->idisp.iface && mod->idisp.iface->render)
{
if(atomic_exchange(&mod->idisp.draw_queued, false))
{
@@ -550,8 +550,7 @@ _mod_worker_thread(void *data)
// spin
}
- if(mod->idisp.iface->render)
- mod->idisp.surf = mod->idisp.iface->render(mod->handle, w, h);
+ mod->idisp.surf = mod->idisp.iface->render(mod->handle, w, h);
// unlock surface
atomic_flag_clear(&mod->idisp.lock);