[DEBUG] correct some crash
This commit is contained in:
parent
adfb75d258
commit
c667f6c327
@ -244,10 +244,10 @@ void drain::FormatUpdate::configurationChange() {
|
|||||||
|
|
||||||
|
|
||||||
bool drain::FormatUpdate::process(std::chrono::system_clock::time_point& _time,
|
bool drain::FormatUpdate::process(std::chrono::system_clock::time_point& _time,
|
||||||
void* _input,
|
void* _input,
|
||||||
size_t _inputNbChunk,
|
size_t _inputNbChunk,
|
||||||
void*& _output,
|
void*& _output,
|
||||||
size_t& _outputNbChunk) {
|
size_t& _outputNbChunk) {
|
||||||
drain::AutoLogInOut tmpLog("FormatUpdate");
|
drain::AutoLogInOut tmpLog("FormatUpdate");
|
||||||
// chack if we need to process:
|
// chack if we need to process:
|
||||||
if (m_needProcess == false) {
|
if (m_needProcess == false) {
|
||||||
|
@ -61,12 +61,18 @@ void drain::Resampler::configurationChange() {
|
|||||||
m_needProcess = false;
|
m_needProcess = false;
|
||||||
return;
|
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
|
#ifdef HAVE_SPEEX_DSP_RESAMPLE
|
||||||
if (m_speexResampler != nullptr) {
|
if (m_speexResampler != nullptr) {
|
||||||
speex_resampler_destroy(m_speexResampler);
|
speex_resampler_destroy(m_speexResampler);
|
||||||
m_speexResampler = nullptr;
|
m_speexResampler = nullptr;
|
||||||
}
|
}
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
DRAIN_WARNING("Create resampler for : " << m_input << " to " << m_output);
|
||||||
m_speexResampler = speex_resampler_init(m_output.getMap().size(),
|
m_speexResampler = speex_resampler_init(m_output.getMap().size(),
|
||||||
m_input.getFrequency(),
|
m_input.getFrequency(),
|
||||||
m_output.getFrequency(),
|
m_output.getFrequency(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user