projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix crash when copy'ing latent plugins
[ardour.git]
/
libs
/
ardour
/
lv2_evbuf.c
diff --git
a/libs/ardour/lv2_evbuf.c
b/libs/ardour/lv2_evbuf.c
index 1cce8730a9f181793b79f5fbd9cba89c03be3378..ae6d869b5fac0a87726d453086cbb66b5b56cced 100644
(file)
--- a/
libs/ardour/lv2_evbuf.c
+++ b/
libs/ardour/lv2_evbuf.c
@@
-115,6
+115,12
@@
lv2_evbuf_get_size(LV2_Evbuf* evbuf)
return 0;
}
return 0;
}
+uint32_t
+lv2_evbuf_get_capacity(LV2_Evbuf* evbuf)
+{
+ return evbuf->capacity;
+}
+
void*
lv2_evbuf_get_buffer(LV2_Evbuf* evbuf)
{
void*
lv2_evbuf_get_buffer(LV2_Evbuf* evbuf)
{
@@
-160,13
+166,13
@@
lv2_evbuf_next(LV2_Evbuf_Iterator iter)
uint32_t size;
switch (evbuf->type) {
case LV2_EVBUF_EVENT:
uint32_t size;
switch (evbuf->type) {
case LV2_EVBUF_EVENT:
- size = ((LV2_Event*)(
evbuf->buf.event.data + offset
))->size;
+ size = ((LV2_Event*)(
(uintptr_t)(evbuf->buf.event.data + offset)
))->size;
offset += lv2_evbuf_pad_size(sizeof(LV2_Event) + size);
break;
case LV2_EVBUF_ATOM:
offset += lv2_evbuf_pad_size(sizeof(LV2_Event) + size);
break;
case LV2_EVBUF_ATOM:
- size = ((LV2_Atom_Event*)
+ size = ((LV2_Atom_Event*)
((uintptr_t)
((char*)LV2_ATOM_CONTENTS(LV2_Atom_Sequence, &evbuf->buf.atom)
((char*)LV2_ATOM_CONTENTS(LV2_Atom_Sequence, &evbuf->buf.atom)
- + offset))->body.size;
+ + offset))
)
->body.size;
offset += lv2_evbuf_pad_size(sizeof(LV2_Atom_Event) + size);
break;
}
offset += lv2_evbuf_pad_size(sizeof(LV2_Atom_Event) + size);
break;
}
@@
-197,7
+203,7
@@
lv2_evbuf_get(LV2_Evbuf_Iterator iter,
switch (iter.evbuf->type) {
case LV2_EVBUF_EVENT:
ebuf = &iter.evbuf->buf.event;
switch (iter.evbuf->type) {
case LV2_EVBUF_EVENT:
ebuf = &iter.evbuf->buf.event;
- ev = (LV2_Event*)
ebuf->data + iter.offset
;
+ ev = (LV2_Event*)
((uintptr_t)((char*)ebuf->data + iter.offset))
;
*frames = ev->frames;
*subframes = ev->subframes;
*type = ev->type;
*frames = ev->frames;
*subframes = ev->subframes;
*type = ev->type;
@@
-206,14
+212,14
@@
lv2_evbuf_get(LV2_Evbuf_Iterator iter,
break;
case LV2_EVBUF_ATOM:
aseq = (LV2_Atom_Sequence*)&iter.evbuf->buf.atom;
break;
case LV2_EVBUF_ATOM:
aseq = (LV2_Atom_Sequence*)&iter.evbuf->buf.atom;
- aev = (LV2_Atom_Event*)(
+ aev = (LV2_Atom_Event*)(
(uintptr_t)(
(char*)LV2_ATOM_CONTENTS(LV2_Atom_Sequence, aseq)
(char*)LV2_ATOM_CONTENTS(LV2_Atom_Sequence, aseq)
- + iter.offset);
+ + iter.offset)
)
;
*frames = aev->time.frames;
*subframes = 0;
*type = aev->body.type;
*size = aev->body.size;
*frames = aev->time.frames;
*subframes = 0;
*type = aev->body.type;
*size = aev->body.size;
- *data = LV2_ATOM_BODY(&aev->body);
+ *data =
(uint8_t*)
LV2_ATOM_BODY(&aev->body);
break;
}
break;
}
@@
-239,7
+245,7
@@
lv2_evbuf_write(LV2_Evbuf_Iterator* iter,
return false;
}
return false;
}
- ev = (LV2_Event*)(
ebuf->data + iter->offset
);
+ ev = (LV2_Event*)(
(uintptr_t)(ebuf->data + iter->offset)
);
ev->frames = frames;
ev->subframes = subframes;
ev->type = type;
ev->frames = frames;
ev->subframes = subframes;
ev->type = type;
@@
-258,9
+264,9
@@
lv2_evbuf_write(LV2_Evbuf_Iterator* iter,
return false;
}
return false;
}
- aev = (LV2_Atom_Event*)(
+ aev = (LV2_Atom_Event*)(
(uintptr_t)(
(char*)LV2_ATOM_CONTENTS(LV2_Atom_Sequence, aseq)
(char*)LV2_ATOM_CONTENTS(LV2_Atom_Sequence, aseq)
- + iter->offset);
+ + iter->offset)
)
;
aev->time.frames = frames;
aev->body.type = type;
aev->body.size = size;
aev->time.frames = frames;
aev->body.type = type;
aev->body.size = size;