diff --git a/src/conference.cpp b/src/conference.cpp index db15cc7935117b7ce3952da0e93fa5c53108828c..6d6fe50f9e49f212fe291dd95bfa059ee7f93c9e 100644 --- a/src/conference.cpp +++ b/src/conference.cpp @@ -114,6 +114,15 @@ Conference::~Conference() call->sendTextMessage(std::map<std::string, std::string> {{"application/confInfo+json", "[]"}}, call->getAccount().getFromUri()); + // Continue the recording for the call if the conference was recorded + if (this->isRecording()) { + JAMI_DBG("Stop recording for conf %s", getConfID().c_str()); + this->toggleRecording(); + if (not call->isRecording()) { + JAMI_DBG("Conference was recorded, start recording for conf %s", call->getCallId().c_str()); + call->toggleRecording(); + } + } } } #endif // ENABLE_VIDEO @@ -136,8 +145,18 @@ Conference::add(const std::string& participant_id) { if (participants_.insert(participant_id).second) { #ifdef ENABLE_VIDEO - if (auto call = Manager::instance().callFactory.getCall<SIPCall>(participant_id)) + if (auto call = Manager::instance().callFactory.getCall<SIPCall>(participant_id)) { call->getVideoRtp().enterConference(this); + // Continue the recording for the conference if one participant was recording + if (call->isRecording()) { + JAMI_DBG("Stop recording for call %s", call->getCallId().c_str()); + call->toggleRecording(); + if (not this->isRecording()) { + JAMI_DBG("One participant was recording, start recording for conference %s", getConfID().c_str()); + this->toggleRecording(); + } + } + } else JAMI_ERR("no call associate to participant %s", participant_id.c_str()); #endif // ENABLE_VIDEO diff --git a/src/media/media_recorder.cpp b/src/media/media_recorder.cpp index 61b195c303a8cea8b1c79799c5f3712ed60abc2b..a5ac873e51953f4f205b36aff658cd988d369591 100644 --- a/src/media/media_recorder.cpp +++ b/src/media/media_recorder.cpp @@ -269,16 +269,11 @@ MediaRecorder::onFrame(const std::string& name, const std::shared_ptr<MediaFrame clone = std::make_unique<MediaFrame>(); clone->copyFrom(*frame); } -#if (defined(TARGET_OS_IOS) && TARGET_OS_IOS) clone->pointer()->pts = av_rescale_q_rnd(av_gettime() - startTimeStamp_, {1, AV_TIME_BASE}, ms.timeBase, static_cast<AVRounding>(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX)); -#else - clone->pointer()->pts -= ms.firstTimestamp; -#endif - std::unique_ptr<MediaFrame> filteredFrame; if (ms.isVideo) { std::lock_guard<std::mutex> lk(mutexFilterVideo_);