Skip to content
Snippets Groups Projects
Commit ddc7b631 authored by Philippe Gorley's avatar Philippe Gorley
Browse files

sipcall: detach recording on stop

Change-Id: Ia0f8f823fb68016fbe497d089b8044a644cd614c
parent 192907ef
No related branches found
No related tags found
No related merge requests found
......@@ -525,8 +525,10 @@ SIPCall::transfer(const std::string& to)
{
auto& account = getSIPAccount();
if (Recordable::isRecording())
if (Recordable::isRecording()) {
deinitRecorder();
stopRecording();
}
std::string toUri = account.getToUri(to);
const pj_str_t dst(CONST_PJ_STR(toUri));
......@@ -1035,8 +1037,10 @@ void
SIPCall::stopAllMedia()
{
JAMI_DBG("[call:%s] stopping all medias", getCallId().c_str());
if (Recordable::isRecording())
Recordable::stopRecording(); // if call stops, finish recording
if (Recordable::isRecording()) {
deinitRecorder();
stopRecording(); // if call stops, finish recording
}
avformatrtp_->stop();
#ifdef ENABLE_VIDEO
videortp_->stop();
......@@ -1272,6 +1276,15 @@ SIPCall::toggleRecording()
videortp_->initRecorder(recorder_);
#endif
} else {
deinitRecorder();
}
return Call::toggleRecording();
}
void
SIPCall::deinitRecorder()
{
if (Call::isRecording()) {
if (avformatrtp_)
avformatrtp_->deinitRecorder(recorder_);
#ifdef ENABLE_VIDEO
......@@ -1279,7 +1292,6 @@ SIPCall::toggleRecording()
videortp_->deinitRecorder(recorder_);
#endif
}
return Call::toggleRecording();
}
void
......
......@@ -239,6 +239,8 @@ public: // NOT SIP RELATED (good candidates to be moved elsewhere)
return tmpMediaTransport_ ? tmpMediaTransport_.get() : mediaTransport_.get();
}
void deinitRecorder();
private:
NON_COPYABLE(SIPCall);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment