summaryrefslogtreecommitdiffstats
path: root/src/server/Buffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/Buffer.cpp')
-rw-r--r--src/server/Buffer.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/server/Buffer.cpp b/src/server/Buffer.cpp
index 4fbb44f9..97f1c308 100644
--- a/src/server/Buffer.cpp
+++ b/src/server/Buffer.cpp
@@ -158,12 +158,10 @@ Buffer::copy(const Context& context, const Buffer* src)
{
if (!_buf) {
return;
- } else if (is_audio() && src->is_audio()) {
- memcpy(_buf, src->_buf, src->_capacity);
} else if (_type == src->type()) {
- const LV2_Atom* src_atom = src->get<const LV2_Atom>();
- if (lv2_atom_total_size(src_atom) <= _capacity) {
- memcpy(_buf, src_atom, lv2_atom_total_size(src_atom));
+ const uint32_t src_size = src->size();
+ if (src_size <= _capacity) {
+ memcpy(_buf, src->_buf, src_size);
} else {
clear();
}