diff --git a/daemon/src/conference.cpp b/daemon/src/conference.cpp index 0d745868ebd4d7b3f86e51ae0204adada9f45203..d098495ba2e4b1edea3134622a6d2500883cbf51 100644 --- a/daemon/src/conference.cpp +++ b/daemon/src/conference.cpp @@ -51,7 +51,7 @@ Conference::Conference() , confState_(ACTIVE_ATTACHED) , participants_() #ifdef SFL_VIDEO - , videoMixer_(new sfl_video::VideoMixer(id_)) + , videoMixer_(nullptr) #endif { Recordable::initRecFilename(id_); @@ -184,6 +184,8 @@ std::string Conference::getConfID() const { #ifdef SFL_VIDEO std::shared_ptr<sfl_video::VideoMixer> Conference::getVideoMixer() { + if (!videoMixer_) + videoMixer_.reset(new sfl_video::VideoMixer(id_)); return videoMixer_; } #endif diff --git a/daemon/src/video/video_rtp_session.cpp b/daemon/src/video/video_rtp_session.cpp index e72a67ef3eee7b4f55e38f67e78dd2fef5235e12..a3b753be45f84081cb8885d1a1de324402000d5a 100644 --- a/daemon/src/video/video_rtp_session.cpp +++ b/daemon/src/video/video_rtp_session.cpp @@ -246,7 +246,8 @@ void VideoRtpSession::setupConferenceVideoPipeline() void VideoRtpSession::getMixerFromConference(Conference &conf) { std::lock_guard<std::mutex> lock(mutex_); - videoMixerSP_ = std::move(conf.getVideoMixer()); + if (sending_ or receiving_) + videoMixerSP_ = std::move(conf.getVideoMixer()); } void VideoRtpSession::enterConference(Conference *conf)