1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-30 03:38:55 -05:00

FreeDV modulator: fixed FreeDV arrays initialization (fixed)

This commit is contained in:
f4exb 2019-02-26 00:19:15 +01:00
parent 5dbf374d0f
commit 9232f67668

View File

@ -692,18 +692,27 @@ void FreeDVMod::applyFreeDVMode(FreeDVModSettings::FreeDVMode mode)
int nNomModemSamples = freedv_get_n_nom_modem_samples(m_freeDV); int nNomModemSamples = freedv_get_n_nom_modem_samples(m_freeDV);
int Fs = freedv_get_modem_sample_rate(m_freeDV); int Fs = freedv_get_modem_sample_rate(m_freeDV);
int Rs = freedv_get_modem_symbol_rate(m_freeDV); int Rs = freedv_get_modem_symbol_rate(m_freeDV);
if ((m_speechIn) && (nSpeechSamples != m_nSpeechSamples)) {
delete[] m_speechIn; if (nSpeechSamples != m_nSpeechSamples)
{
if (m_speechIn) {
delete[] m_speechIn;
}
m_speechIn = new int16_t[nSpeechSamples];
m_nSpeechSamples = nSpeechSamples;
} }
if ((m_modOut) && (nNomModemSamples != m_nNomModemSamples)) { if (nNomModemSamples != m_nNomModemSamples)
delete[] m_modOut; {
if (m_modOut) {
delete[] m_modOut;
}
m_modOut = new int16_t[nNomModemSamples];
m_nNomModemSamples = nNomModemSamples;
} }
m_nSpeechSamples = nSpeechSamples;
m_nNomModemSamples = nNomModemSamples;
m_speechIn = new int16_t[m_nSpeechSamples];
m_modOut = new int16_t[m_nNomModemSamples];
m_iSpeech = 0; m_iSpeech = 0;
m_iModem = 0; m_iModem = 0;