From: Carl Hetherington Date: Sun, 30 Oct 2016 19:41:59 +0000 (+0000) Subject: const-correctness fix (#985). X-Git-Tag: v2.9.39~30 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=5b04f870694373ad9c6086aed5ab38b0c6b41ccc;hp=ac023cc70a09e857f56bd328de346ed14e5b6b52;p=dcpomatic.git const-correctness fix (#985). --- 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 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 in) } } + data.data_in = in_buffer; data.input_frames = in_frames; data.data_out = new float[max_resampled_frames * _channels];