Commit 1b45e68e authored by Tristan Matthews's avatar Tristan Matthews

* #14455: audiortp: don't destroy noise suppress if not holding the audioProcessMutex

parent ea31864e
......@@ -88,8 +88,11 @@ AudioRtpRecord::~AudioRtpRecord()
delete converterDecode_;
delete audioCodec_;
#if HAVE_SPEEXDSP
delete noiseSuppressEncode_;
delete noiseSuppressDecode_;
{
ost::MutexLock lock(audioProcessMutex_);
delete noiseSuppressDecode_;
delete noiseSuppressEncode_;
}
#endif
}
......
......@@ -59,10 +59,13 @@ NoiseSuppress::NoiseSuppress(int smplPerFrame, int samplingRate) :
NoiseSuppress::~NoiseSuppress()
{
speex_preprocess_state_destroy(noiseState_);
noiseState_ = 0;
}
void NoiseSuppress::process(SFLDataFormat *data, int samples)
{
assert(smplPerFrame_ == samples);
speex_preprocess_run(noiseState_, data);
if (noiseState_) {
assert(smplPerFrame_ == samples);
speex_preprocess_run(noiseState_, data);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment