Fix moodbars not generating correctly

The magnitude output from gstfastspectrum was not initialized for the first fft.
In some cases, the memory would contain data that upon math operations becomes nan.
This causes one or more colours of the moodbar to be generated blank, resulting in missing colours or just plain black moodbars.
This commit is contained in:
Mark Furneaux 2014-12-21 23:11:02 -05:00
parent 4f66b6d453
commit 1d31378174
1 changed files with 1 additions and 0 deletions

View File

@ -139,6 +139,7 @@ gst_fastspectrum_alloc_channel_data (GstFastSpectrum * spectrum)
fftw_malloc(sizeof(fftw_complex) * (nfft/2+1)));
spectrum->spect_magnitude = new double[bands];
memset(spectrum->spect_magnitude, 0, spectrum->bands * sizeof(double));
GstFastSpectrumClass* klass = reinterpret_cast<GstFastSpectrumClass*>(
G_OBJECT_GET_CLASS(spectrum));