summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/ardour/interpolation.cc7
-rw-r--r--libs/ardour/tests/interpolation-test.cc4
2 files changed, 7 insertions, 4 deletions
diff --git a/libs/ardour/interpolation.cc b/libs/ardour/interpolation.cc
index d7f1c835df..311f962471 100644
--- a/libs/ardour/interpolation.cc
+++ b/libs/ardour/interpolation.cc
@@ -195,9 +195,12 @@ LibSamplerateInterpolation::add_channel_to (int input_buffer_size, int output_bu
void
LibSamplerateInterpolation::remove_channel_from ()
{
- delete data.back ();
+ SRC_DATA* d = data.back ();
+ delete d;
data.pop_back ();
- delete state.back ();
+ if (state.back ()) {
+ src_delete (state.back ());
+ }
state.pop_back ();
reset_state ();
}
diff --git a/libs/ardour/tests/interpolation-test.cc b/libs/ardour/tests/interpolation-test.cc
index 87079b92a5..ec14abd8d3 100644
--- a/libs/ardour/tests/interpolation-test.cc
+++ b/libs/ardour/tests/interpolation-test.cc
@@ -16,7 +16,7 @@ InterpolationTest::linearInterpolationTest ()
for (int i = 0; i < NUM_SAMPLES - 1024;) {
linear.set_speed (double(1.0)/double(3.0));
linear.set_target_speed (double(1.0)/double(3.0));
- printf ("Interpolate: input: %d, output: %d, i: %d\n", input + i, output + i, i);
+ //printf ("Interpolate: input: %d, output: %d, i: %d\n", input + i, output + i, i);
result = linear.interpolate (0, 1024, input + i, output + i);
printf ("Result: %d\n", result);
//CPPUNIT_ASSERT_EQUAL ((uint32_t)((NUM_SAMPLES - 100) * interpolation.speed()), result);
@@ -115,7 +115,7 @@ InterpolationTest::libSamplerateInterpolationTest ()
cout << "\nSpeed: 0.5";
for (int i = 0; i < NUM_SAMPLES;) {
interpolation.set_speed (0.5);
- printf ("Interpolate: input: %d, output: %d, i: %d\n", input + i, output + i, i);
+ //printf ("Interpolate: input: %d, output: %d, i: %d\n", input + i, output + i, i);
result = interpolation.interpolate (0, NUM_SAMPLES - 100, input + i, output + i);
printf ("Result: %d\n", result);
//CPPUNIT_ASSERT_EQUAL ((uint32_t)((NUM_SAMPLES - 100) * interpolation.speed()), result);