From 33707e6310ed15bcc4572de0f9c1ebad6df43ecc Mon Sep 17 00:00:00 2001 From: Tristan Matthews <tristan.matthews@savoirfairelinux.com> Date: Thu, 25 Aug 2011 14:45:22 -0400 Subject: [PATCH] * #6731: removed bad assertion --- daemon/src/sip/sipvoiplink.cpp | 2 +- daemon/src/video/video_rtp_session.cpp | 11 ++++------- daemon/src/video/video_rtp_session.h | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/daemon/src/sip/sipvoiplink.cpp b/daemon/src/sip/sipvoiplink.cpp index 870e2e7c53..c64fd3c7e6 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 21b889b73d..7201fb8cbe 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 04f3767efe..ec855ae66b 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_; -- GitLab