Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Audio SDES packets that were corrupted in OTM #1483

Merged
merged 1 commit into from
Oct 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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