interpolation: fix some warnings

git-svn-id: svn://localhost/ardour2/branches/3.0@5261 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Hans Baier 2009-06-23 14:53:42 +00:00
parent 2641040701
commit d45dfa5cb6
2 changed files with 7 additions and 4 deletions

View file

@ -195,9 +195,12 @@ LibSamplerateInterpolation::add_channel_to (int input_buffer_size, int output_bu
void void
LibSamplerateInterpolation::remove_channel_from () LibSamplerateInterpolation::remove_channel_from ()
{ {
delete data.back (); SRC_DATA* d = data.back ();
delete d;
data.pop_back (); data.pop_back ();
delete state.back (); if (state.back ()) {
src_delete (state.back ());
}
state.pop_back (); state.pop_back ();
reset_state (); reset_state ();
} }

View file

@ -16,7 +16,7 @@ InterpolationTest::linearInterpolationTest ()
for (int i = 0; i < NUM_SAMPLES - 1024;) { for (int i = 0; i < NUM_SAMPLES - 1024;) {
linear.set_speed (double(1.0)/double(3.0)); linear.set_speed (double(1.0)/double(3.0));
linear.set_target_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); result = linear.interpolate (0, 1024, input + i, output + i);
printf ("Result: %d\n", result); printf ("Result: %d\n", result);
//CPPUNIT_ASSERT_EQUAL ((uint32_t)((NUM_SAMPLES - 100) * interpolation.speed()), result); //CPPUNIT_ASSERT_EQUAL ((uint32_t)((NUM_SAMPLES - 100) * interpolation.speed()), result);
@ -115,7 +115,7 @@ InterpolationTest::libSamplerateInterpolationTest ()
cout << "\nSpeed: 0.5"; cout << "\nSpeed: 0.5";
for (int i = 0; i < NUM_SAMPLES;) { for (int i = 0; i < NUM_SAMPLES;) {
interpolation.set_speed (0.5); 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); result = interpolation.interpolate (0, NUM_SAMPLES - 100, input + i, output + i);
printf ("Result: %d\n", result); printf ("Result: %d\n", result);
//CPPUNIT_ASSERT_EQUAL ((uint32_t)((NUM_SAMPLES - 100) * interpolation.speed()), result); //CPPUNIT_ASSERT_EQUAL ((uint32_t)((NUM_SAMPLES - 100) * interpolation.speed()), result);