diff --git a/daemon/src/sip/sipvoiplink.cpp b/daemon/src/sip/sipvoiplink.cpp index 870e2e7c53e42a89974613e87177b5e66737da30..c64fd3c7e69a852ac98ccdb094aff231d5165d93 100644 --- a/daemon/src/sip/sipvoiplink.cpp +++ b/daemon/src/sip/sipvoiplink.cpp @@ -2694,7 +2694,7 @@ void sdp_media_update_cb (pjsip_inv_session *inv, pj_status_t status) audioRTPSessionValid = false; } - call->getVideoRtp()->updateSDP(call->getLocalSDP()); + call->getVideoRtp()->updateSDP(*call->getLocalSDP()); call->getVideoRtp()->updateDestination(call->getLocalSDP()->getRemoteIP(), call->getLocalSDP()->getRemoteVideoPort()); call->getVideoRtp()->start(); diff --git a/daemon/src/video/video_rtp_session.cpp b/daemon/src/video/video_rtp_session.cpp index 21b889b73df3b15ed6121763237469a0fd68f47a..7201fb8cbe7d3a026fb38c81d22feb689d7058b8 100644 --- a/daemon/src/video/video_rtp_session.cpp +++ b/daemon/src/video/video_rtp_session.cpp @@ -57,15 +57,13 @@ VideoRtpSession::VideoRtpSession(const std::map<std::string, std::string> &txArg txArgs_(txArgs), rxArgs_(rxArgs), sending_(true), receiving_(true) {} -void VideoRtpSession::updateSDP(const Sdp *sdp) +void VideoRtpSession::updateSDP(const Sdp &sdp) { - std::vector<std::string> v(sdp->getActiveVideoDescription()); + std::vector<std::string> v(sdp.getActiveVideoDescription()); const std::string &desc = v[0]; // if port has changed if (desc != rxArgs_["receiving_sdp"]) { - assert(receiveThread_.get() == 0); - rxArgs_["receiving_sdp"] = desc; _debug("%s:Updated incoming SDP to:\n %s", __PRETTY_FUNCTION__, rxArgs_["receiving_sdp"].c_str()); @@ -104,12 +102,11 @@ void VideoRtpSession::updateSDP(const Sdp *sdp) } std::string codec = libav_utils::encodersMap()[v[1]]; - if (codec == "") { + if (codec.empty()) { _debug("Couldn't find encoder for \"%s\"\n", v[1].c_str()); sending_ = false; - } else { + } else txArgs_["codec"] = codec; - } } void VideoRtpSession::updateDestination(const std::string &destination, diff --git a/daemon/src/video/video_rtp_session.h b/daemon/src/video/video_rtp_session.h index 04f3767efea59da1e9098b526bef48ea9d6b9259..ec855ae66b63980427cb3d2f7b535df51a4fe978 100644 --- a/daemon/src/video/video_rtp_session.h +++ b/daemon/src/video/video_rtp_session.h @@ -54,7 +54,7 @@ class VideoRtpSession { void test_loopback(); void updateDestination(const std::string &destination, unsigned int port); - void updateSDP(const Sdp *sdp); + void updateSDP(const Sdp &sdp); private: std::tr1::shared_ptr<VideoSendThread> sendThread_;