const-correctness fix (#985).
authorCarl Hetherington <cth@carlh.net>
Sun, 30 Oct 2016 19:41:59 +0000 (19:41 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 30 Oct 2016 19:41:59 +0000 (19:41 +0000)
src/lib/resampler.cc

index 80175e5f7e505fc72a267ef5951824a2e4a50634..01d71c79b68219caefff036363336eb5e23a55f6 100644 (file)
@@ -81,11 +81,11 @@ Resampler::run (shared_ptr<const AudioBuffers> in)
                int const max_resampled_frames = ceil ((double) in_frames * _out_rate / _in_rate) + 32;
 
                SRC_DATA data;
-               data.data_in = new float[in_frames * _channels];
+               float* in_buffer = new float[in_frames * _channels];
 
                {
                        float** p = in->data ();
-                       float* q = data.data_in;
+                       float* q = in_buffer;
                        for (int i = 0; i < in_frames; ++i) {
                                for (int j = 0; j < _channels; ++j) {
                                        *q++ = p[j][in_offset + i];
@@ -93,6 +93,7 @@ Resampler::run (shared_ptr<const AudioBuffers> in)
                        }
                }
 
+               data.data_in = in_buffer;
                data.input_frames = in_frames;
 
                data.data_out = new float[max_resampled_frames * _channels];