From d45dfa5cb602da24d2cbcbca00ff7c69ba18c4cb Mon Sep 17 00:00:00 2001 From: Hans Baier Date: Tue, 23 Jun 2009 14:53:42 +0000 Subject: interpolation: fix some warnings git-svn-id: svn://localhost/ardour2/branches/3.0@5261 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/interpolation.cc | 7 +++++-- libs/ardour/tests/interpolation-test.cc | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'libs') 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); -- cgit v1.2.3