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