Skip to content

Commit

Permalink
Update RTCP SR timestamps in Simulcast (#1489)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcague authored Nov 6, 2019
1 parent feebd7c commit df60a82
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 1 addition & 2 deletions erizo/src/erizo/OneToManyProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ namespace erizo {
RtcpHeader* chead = reinterpret_cast<RtcpHeader*>(audio_packet->data);
for (it = subscribers.begin(); it != subscribers.end(); ++it) {
if ((*it).second != nullptr) {
// Hack to avoid audio drifting in Chrome.
if (chead->isRtcp() && chead->isSDES()) {
if (chead->isRtcp()) {
chead->setSSRC((*it).second->getAudioSinkSSRC());
} else {
head->setSSRC((*it).second->getAudioSinkSSRC());
Expand Down
8 changes: 6 additions & 2 deletions erizo/src/erizo/rtp/QualityFilterHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,14 @@ void QualityFilterHandler::write(Context *ctx, std::shared_ptr<DataPacket> packe
tl0_pic_idx_sent : last_tl0_pic_idx_sent_;
updateTL0PicIdx(packet, tl0_pic_idx_sent);
// removeVP8OptionalPayload(packet); // TODO(javier): uncomment this line in case of issues with pictureId
} else if (is_scalable_ && enabled_ && chead->isRtcp() && chead->isSenderReport()) {
uint32_t ssrc = chead->getSSRC();
if (video_sink_ssrc_ == ssrc) {
uint32_t sr_timestamp = chead->getTimestamp();
chead->setTimestamp(sr_timestamp + timestamp_offset_);
}
}

// TODO(javier): Handle SRs?

ctx->fireWrite(packet);
}

Expand Down
6 changes: 6 additions & 0 deletions erizo/src/erizo/rtp/RtpHeaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,12 @@ class RtcpHeader {
uint64_t middle = (report.senderReport.ntptimestamp << 16) >> 32;
return ntohl(middle);
}
inline void setTimestamp(uint32_t timestamp) {
report.senderReport.rtprts = htonl(timestamp);
}
inline uint32_t getTimestamp() {
return ntohl(report.senderReport.rtprts);
}
inline uint16_t getNackPid() {
return report.nackPacket.nack_block.getNackPid();
}
Expand Down

0 comments on commit df60a82

Please sign in to comment.