Commit fda3fbf9 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#3124] Delete audio codec when stopping RTP session

parent 58a8163a
......@@ -267,6 +267,10 @@ namespace sfl {
delete [] _spkrDataConverted;
delete _time;
delete _converter;
if (_audiocodec) {
delete _audiocodec; _audiocodec = NULL;
}
}
template <typename D>
......@@ -615,7 +619,7 @@ namespace sfl {
_debug("RTP: Starting main thread");
setSessionTimeouts();
setSessionMedia(audiocodec);
initBuffers();
initBuffers();
return start(_mainloopSemaphore);
}
......
......@@ -221,8 +221,6 @@ AudioCodec* CodecDescriptor::loadCodec (std::string path) {
void CodecDescriptor::unloadCodec (CodecHandlePointer p) {
_debug("CodecDescriptor: Unload codec");
using std::cerr;
destroy_t* destroyCodec = (destroy_t*) dlsym (p.second , "destroy");
......@@ -250,15 +248,15 @@ AudioCodec* CodecDescriptor::instantiateCodec (AudioCodecType payload) {
AudioCodec* a = createCodec();
return a;
}
iter++;
}
return NULL;
}
AudioCodec* CodecDescriptor::getFirstCodecAvailable (void) {
CodecsMap::iterator iter = _CodecsMap.begin();
......
......@@ -3276,14 +3276,14 @@ void call_on_media_update (pjsip_inv_session *inv, pj_status_t status)
AudioCodec* audiocodec = Manager::instance().getCodecDescriptorMap().instantiateCodec(pl);
if (audiocodec == NULL)
_error ("SIP: No audiocodec found");
_error ("UserAgent: No audiocodec found");
try {
call->setAudioStart (true);
call->getAudioRtp()->start(audiocodec);
} catch (exception& rtpException) {
_debug ("%s", rtpException.what());
_error ("UserAgent: Error: %s", rtpException.what());
}
}
......
Supports Markdown
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