Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 22554d99 authored by Pali Rohár's avatar Pali Rohár

libjingle: Do not drop rtp packets with invalid ssrc

Before ssrc stream parameter in libjingle Kopete tree was fixed, Kopete
was sending invalid ssrc value. Other (broken) libjingle clients could do
it too. So do not drop those rtp packets otherwise no audio data from older
Kopete versions will be received.
parent 4dbdd0c3
diff --git a/protocols/jabber/libjingle/talk/session/phone/ssrcmuxfilter.cc b/protocols/jabber/libjingle/talk/session/phone/ssrcmuxfilter.cc
index d81feab..188daa2 100644
--- a/protocols/jabber/libjingle/talk/session/phone/ssrcmuxfilter.cc
+++ b/protocols/jabber/libjingle/talk/session/phone/ssrcmuxfilter.cc
@@ -49,7 +49,7 @@ bool SsrcMuxFilter::IsActive() const {
bool SsrcMuxFilter::DemuxPacket(const char* data, size_t len, bool rtcp) {
uint32 ssrc = 0;
if (!rtcp) {
- GetRtpSsrc(data, len, &ssrc);
+ if (!GetRtpSsrc(data, len, &ssrc)) return false;
} else {
int pl_type = 0;
if (!GetRtcpType(data, len, &pl_type)) return false;
@@ -67,7 +67,12 @@ bool SsrcMuxFilter::DemuxPacket(const char* data, size_t len, bool rtcp) {
}
}
}
- return FindStream(ssrc);
+ bool found = FindStream(ssrc);
+ if (rtcp)
+ return found;
+ if (!found)
+ LOG(LS_WARNING) << "Stream with ssrc " << ssrc << " is not in filter! But still processing";
+ return true;
}
bool SsrcMuxFilter::AddStream(const StreamParams& stream) {
......@@ -49,7 +49,7 @@ bool SsrcMuxFilter::IsActive() const {
bool SsrcMuxFilter::DemuxPacket(const char* data, size_t len, bool rtcp) {
uint32 ssrc = 0;
if (!rtcp) {
GetRtpSsrc(data, len, &ssrc);
if (!GetRtpSsrc(data, len, &ssrc)) return false;
} else {
int pl_type = 0;
if (!GetRtcpType(data, len, &pl_type)) return false;
......@@ -67,7 +67,12 @@ bool SsrcMuxFilter::DemuxPacket(const char* data, size_t len, bool rtcp) {
}
}
}
return FindStream(ssrc);
bool found = FindStream(ssrc);
if (rtcp)
return found;
if (!found)
LOG(LS_WARNING) << "Stream with ssrc " << ssrc << " is not in filter! But still processing";
return true;
}
bool SsrcMuxFilter::AddStream(const StreamParams& stream) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment