SpectrumAnalyzer: fixed multiple instantiations

When instantiating the SpectrumAnalyzer plugin more than once the
processed data somehow got invalid and caused all but the first
SpectrumAnalyzer instance not to work at all. This can be fixed easily
by clearing m_buffer in SpectrumAnalyzer's constructor.

Closes #3137877.
This commit is contained in:
Tobias Doerffel
2010-12-24 00:30:27 +01:00
parent 5143b6ad21
commit ab814c03a7

View File

@@ -56,6 +56,8 @@ spectrumAnalyzer::spectrumAnalyzer( Model * _parent,
m_framesFilledUp( 0 ),
m_energy( 0 )
{
memset( m_buffer, 0, sizeof( m_buffer ) );
m_specBuf = (fftwf_complex *) fftwf_malloc( ( FFT_BUFFER_SIZE + 1 ) *
sizeof( fftwf_complex ) );
m_fftPlan = fftwf_plan_dft_r2c_1d( FFT_BUFFER_SIZE*2, m_buffer,