[DEBUG] correct some crash

This commit is contained in:
Edouard DUPIN 2015-02-13 21:06:55 +01:00
parent adfb75d258
commit c667f6c327
2 changed files with 10 additions and 4 deletions

View File

@ -244,10 +244,10 @@ void drain::FormatUpdate::configurationChange() {
bool drain::FormatUpdate::process(std::chrono::system_clock::time_point& _time,
void* _input,
size_t _inputNbChunk,
void*& _output,
size_t& _outputNbChunk) {
void* _input,
size_t _inputNbChunk,
void*& _output,
size_t& _outputNbChunk) {
drain::AutoLogInOut tmpLog("FormatUpdate");
// chack if we need to process:
if (m_needProcess == false) {

View File

@ -61,12 +61,18 @@ void drain::Resampler::configurationChange() {
m_needProcess = false;
return;
}
if ( m_input.getFrequency() == 0
|| m_output.getFrequency() == 0) {
DRAIN_WARNING("Configure IO with 0 frequency ... " << m_input << " to " << m_output);
return;
}
#ifdef HAVE_SPEEX_DSP_RESAMPLE
if (m_speexResampler != nullptr) {
speex_resampler_destroy(m_speexResampler);
m_speexResampler = nullptr;
}
int err = 0;
DRAIN_WARNING("Create resampler for : " << m_input << " to " << m_output);
m_speexResampler = speex_resampler_init(m_output.getMap().size(),
m_input.getFrequency(),
m_output.getFrequency(),