1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-01-03 05:21:57 +01:00

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

View File

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