summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-05-31 03:05:11 +0000
committerDavid Robillard <d@drobilla.net>2012-05-31 03:05:11 +0000
commit9fd21f53cc22d19534bc1746c0f6a47d9c3b6b9a (patch)
tree3c01fdc52c91e881c77a50352ffd51bbb6c5d2bd /src
parenta62965fa2e16f283680de5580e5bb6307fdf2a01 (diff)
downloadingen-9fd21f53cc22d19534bc1746c0f6a47d9c3b6b9a.tar.gz
ingen-9fd21f53cc22d19534bc1746c0f6a47d9c3b6b9a.tar.bz2
ingen-9fd21f53cc22d19534bc1746c0f6a47d9c3b6b9a.zip
Fix glitchy audio.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4476 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/server/AudioBuffer.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/server/AudioBuffer.cpp b/src/server/AudioBuffer.cpp
index 740e780c..0b42435f 100644
--- a/src/server/AudioBuffer.cpp
+++ b/src/server/AudioBuffer.cpp
@@ -45,12 +45,11 @@ AudioBuffer::AudioBuffer(BufferFactory& bufs, LV2_URID type, uint32_t size)
LV2_Atom_Vector* vec = (LV2_Atom_Vector*)_atom;
vec->body.child_size = sizeof(float);
vec->body.child_type = bufs.uris().atom_Float;
- _atom->size = size - sizeof(LV2_Atom_Vector);
- } else {
- _atom->size = size - sizeof(LV2_Atom);
}
+ _atom->size = size - sizeof(LV2_Atom);
_atom->type = type;
+
clear();
}
@@ -139,21 +138,14 @@ AudioBuffer::copy(Context& context, const Buffer* src)
}
if (src_abuf->is_control() == is_control()) {
- // Control => Control
+ // Rates match, direct copy
Buffer::copy(context, src);
- } else if (!src_abuf->is_control() && !is_control()) {
- // Audio => Audio
- copy(src_abuf->data(),
- context.offset(), context.offset() + context.nframes() - 1);
} else if (!src_abuf->is_control() && is_control()) {
// Audio => Control
data()[0] = src_abuf->data()[context.offset()];
} else if (src_abuf->is_control() && !is_control()) {
// Control => Audio
data()[context.offset()] = src_abuf->data()[0];
- } else {
- // Control => Audio or Audio => Control
- set_block(src_abuf->data()[0], 0, nframes());
}
}