From 68bd2370615ac8803e9fc4a708a7783909f34da3 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 5 Oct 2009 23:44:53 +0200 Subject: [PATCH] Revert "CALF: removed usage of non-standard std::vector::data()" This reverts commit dd260245ec2d10d32a77ca2464490445f8fb858e. The commit fixed the compilation problem but according to upstream causes new problems because of the huge data structures on the stack. Upstream provided a better patch which will be applied next. --- plugins/ladspa_effect/calf/calf/osc.h | 6 ++++-- plugins/ladspa_effect/calf/src/organ.cpp | 9 +++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/plugins/ladspa_effect/calf/calf/osc.h b/plugins/ladspa_effect/calf/calf/osc.h index 0d75c575a..36c19fe3c 100644 --- a/plugins/ladspa_effect/calf/calf/osc.h +++ b/plugins/ladspa_effect/calf/calf/osc.h @@ -111,7 +111,9 @@ struct bandlimiter void make_waveform(float output[SIZE], int cutoff, bool foldover = false) { dsp::fft &fft = get_fft(); - std::complex new_spec[SIZE], iffted[SIZE]; + std::vector > new_spec, iffted; + new_spec.resize(SIZE); + iffted.resize(SIZE); // Copy original harmonics up to cutoff point new_spec[0] = spectrum[0]; for (int i = 1; i < cutoff; i++) @@ -144,7 +146,7 @@ struct bandlimiter new_spec[SIZE - i] = 0.f; } // convert back to time domain (IFFT) and extract only real part - fft.calculate(new_spec, iffted, true); + fft.calculate(new_spec.data(), iffted.data(), true); for (int i = 0; i < SIZE; i++) output[i] = iffted[i].real(); } diff --git a/plugins/ladspa_effect/calf/src/organ.cpp b/plugins/ladspa_effect/calf/src/organ.cpp index 18373c89d..661b73b15 100644 --- a/plugins/ladspa_effect/calf/src/organ.cpp +++ b/plugins/ladspa_effect/calf/src/organ.cpp @@ -171,10 +171,11 @@ static void padsynth(bandlimiter blSrc, bandlimiter tmp; + tmp.resize(ORGAN_BIG_WAVE_SIZE); + blDest.compute_waveform(tmp.data()); + normalize_waveform(tmp.data(), ORGAN_BIG_WAVE_SIZE); + blDest.compute_spectrum(tmp.data()); // limit is 1/2 of the number of harmonics of the original wave result.make_from_spectrum(blDest, foldover, ORGAN_WAVE_SIZE >> (1 + ORGAN_BIG_WAVE_SHIFT));