diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-10-30 19:41:59 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-10-30 19:41:59 +0000 |
| commit | 5b04f870694373ad9c6086aed5ab38b0c6b41ccc (patch) | |
| tree | 4ffa78b90a99945e111a6d678d7f0f7d8a721965 /src/lib | |
| parent | ac023cc70a09e857f56bd328de346ed14e5b6b52 (diff) | |
const-correctness fix (#985).
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/resampler.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/resampler.cc b/src/lib/resampler.cc index 80175e5f7..01d71c79b 100644 --- a/src/lib/resampler.cc +++ b/src/lib/resampler.cc @@ -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]; |
