From 37a90cabcf1c5c45a327a66ba2fb72263bbe2619 Mon Sep 17 00:00:00 2001 From: Hannu Haahti Date: Tue, 15 Jul 2014 11:12:04 +0300 Subject: [PATCH 1/2] SamplePlayHandle: increment the right buffer --- src/core/SamplePlayHandle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/SamplePlayHandle.cpp b/src/core/SamplePlayHandle.cpp index 5e3a4c37e..14958904b 100644 --- a/src/core/SamplePlayHandle.cpp +++ b/src/core/SamplePlayHandle.cpp @@ -111,7 +111,7 @@ void SamplePlayHandle::play( sampleFrame * buffer ) // apply offset for the first period if( framesDone() == 0 ) { - buffer += offset(); + workingBuffer += offset(); frames -= offset(); } From 5fef919c4a813d782eb37f7dae0e88bfdf0761be Mon Sep 17 00:00:00 2001 From: Hannu Haahti Date: Tue, 15 Jul 2014 11:28:53 +0300 Subject: [PATCH 2/2] SamplePlayHandle: clear unused frames from buffer --- src/core/SamplePlayHandle.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/SamplePlayHandle.cpp b/src/core/SamplePlayHandle.cpp index 14958904b..c29552d09 100644 --- a/src/core/SamplePlayHandle.cpp +++ b/src/core/SamplePlayHandle.cpp @@ -111,6 +111,7 @@ void SamplePlayHandle::play( sampleFrame * buffer ) // apply offset for the first period if( framesDone() == 0 ) { + memset( buffer, 0, sizeof( sampleFrame ) * offset() ); workingBuffer += offset(); frames -= offset(); }