Skip to content

Commit

Permalink
Fix Audio SDES packets that were corrupted in OTM (lynckia#1483)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcague authored Oct 21, 2019
1 parent 4428219 commit 1c104f4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
7 changes: 6 additions & 1 deletion erizo/src/erizo/OneToManyProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@ namespace erizo {

std::map<std::string, std::shared_ptr<MediaSink>>::iterator it;
RtpHeader* head = reinterpret_cast<RtpHeader*>(audio_packet->data);
RtcpHeader* chead = reinterpret_cast<RtcpHeader*>(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);
}
Expand Down
21 changes: 21 additions & 0 deletions erizo/src/erizo/rtp/RtpHeaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
};


Expand Down

0 comments on commit 1c104f4

Please sign in to comment.