From 9fd21f53cc22d19534bc1746c0f6a47d9c3b6b9a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 31 May 2012 03:05:11 +0000 Subject: Fix glitchy audio. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4476 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/AudioBuffer.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/server/AudioBuffer.cpp') 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()); } } -- cgit v1.2.1