From 1c104f456183a5baca52674ce6469f16c276d062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Cervi=C3=B1o?= Date: Tue, 22 Oct 2019 00:12:13 +0200 Subject: [PATCH] Fix Audio SDES packets that were corrupted in OTM (#1483) --- erizo/src/erizo/OneToManyProcessor.cpp | 7 ++++++- erizo/src/erizo/rtp/RtpHeaders.h | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/erizo/src/erizo/OneToManyProcessor.cpp b/erizo/src/erizo/OneToManyProcessor.cpp index d38d897d42..4b9d9273ae 100644 --- a/erizo/src/erizo/OneToManyProcessor.cpp +++ b/erizo/src/erizo/OneToManyProcessor.cpp @@ -30,9 +30,14 @@ namespace erizo { std::map>::iterator it; RtpHeader* head = reinterpret_cast(audio_packet->data); + RtcpHeader* chead = reinterpret_cast(audio_packet->data); for (it = subscribers.begin(); it != subscribers.end(); ++it) { if ((*it).second != nullptr) { - head->setSSRC((*it).second->getAudioSinkSSRC()); + if (chead->isRtcp()) { + chead->setSSRC((*it).second->getAudioSinkSSRC()); + } else { + head->setSSRC((*it).second->getAudioSinkSSRC()); + } // Note: deliverAudioData must copy the packet inmediately (*it).second->deliverAudioData(audio_packet); } diff --git a/erizo/src/erizo/rtp/RtpHeaders.h b/erizo/src/erizo/rtp/RtpHeaders.h index 9919eb81d7..ade26dcc3e 100644 --- a/erizo/src/erizo/rtp/RtpHeaders.h +++ b/erizo/src/erizo/rtp/RtpHeaders.h @@ -377,6 +377,12 @@ class RtcpHeader { struct receiverReport_t rrlist[1]; } senderReport; + struct sdes_t { + uint32_t type:8; + uint32_t length:8; + char data[1]; + } sdes; + struct genericNack_t { uint32_t ssrcsource; NackBlock nack_block; @@ -414,6 +420,12 @@ class RtcpHeader { inline bool isReceiverReport() { return packettype == RTCP_Receiver_PT; } + inline bool isSenderReport() { + return packettype == RTCP_Sender_PT; + } + inline bool isSDES() { + return packettype == RTCP_SDES_PT; + } inline bool isREMB() { return packettype == RTCP_PS_Feedback_PT && blockcount == RTCP_AFB; } @@ -574,6 +586,15 @@ class RtcpHeader { inline void setFIRSequenceNumber(uint8_t seq_number) { report.fir.seqnumber = seq_number; } + inline uint32_t getSDESType() { + return report.sdes.type; + } + inline uint32_t getSDESLength() { + return report.sdes.length; + } + inline char* getSDESData() { + return report.sdes.data; + } };