summaryrefslogtreecommitdiff
path: root/plugins/Jingle
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-09-02 11:25:58 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-09-02 11:27:08 +0300
commit6753aca9ffa6a0569cf6cba2a47cda0e364f458c (patch)
tree9bdd9d6d1bbf9e3f3b7d0824ff7feb8d1891c96e /plugins/Jingle
parentf53f11cffd16e9bfc84c22dd644906db34b44d60 (diff)
Jingle: fix for occasional crash
Diffstat (limited to 'plugins/Jingle')
-rw-r--r--plugins/Jingle/src/voip.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/plugins/Jingle/src/voip.cpp b/plugins/Jingle/src/voip.cpp
index 8ca7eed036..e84b1ea01a 100644
--- a/plugins/Jingle/src/voip.cpp
+++ b/plugins/Jingle/src/voip.cpp
@@ -382,20 +382,18 @@ bool CJabberAccount::OnRTPDescription(const TiXmlElement *jingleNode)
CMStringA sdp_string(FORMAT, "v=0\r\no=- 0 0 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=ice-options:trickle\r\n"
"m=audio 9 UDP/TLS/RTP/SAVPF 111\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:%s\r\na=ice-pwd:%s\r\na=rtcp-mux\r\na=sendrecv\r\na=rtpmap:111 OPUS/48000/2\r\n"
+ "a=rtcp-fb:111 transport-cc\r\na=fmtp:111 minptime=10;useinbandfec=1\r\n",
+ XmlGetAttr(transport, "ufrag"), XmlGetAttr(transport, "pwd"));
+
+ if (source) {
+ sdp_string.AppendFormat("a=ssrc:%s msid:%s\r\na=ssrc:%s cname:%s\r\n",
+ XmlGetAttr(source, "ssrc"),
+ XmlGetAttr(XmlGetChildByTag(source, "parameter", "name", "msid"), "value"),
+ XmlGetAttr(source, "ssrc"),
+ XmlGetAttr(XmlGetChildByTag(source, "parameter", "name", "cname"), "value"));
+ }
- "a=rtcp-fb:111 transport-cc\r\na=fmtp:111 minptime=10;useinbandfec=1\r\n"
- "a=ssrc:%s msid:%s\r\n"
- "a=ssrc:%s cname:%s\r\n"
-
- "a=mid:%s\r\na=setup:%s\r\na=fingerprint:sha-256 %s\r\na=rtcp-mux-only\r\n",
- XmlGetAttr(transport, "ufrag"),
- XmlGetAttr(transport, "pwd"),
-
- XmlGetAttr(source, "ssrc"),
- XmlGetAttr(XmlGetChildByTag(source, "parameter", "name", "msid"), "value"),
- XmlGetAttr(source, "ssrc"),
- XmlGetAttr(XmlGetChildByTag(source, "parameter", "name", "cname"), "value"),
-
+ sdp_string.AppendFormat("a=mid:%s\r\na=setup:%s\r\na=fingerprint:sha-256 %s\r\na=rtcp-mux-only\r\n",
XmlGetAttr(content, "name"),
XmlGetAttr(XmlFirstChild(transport, "fingerprint"), "setup"),
XmlFirstChild(transport, "fingerprint")->GetText());