Skip to content

Commit

Permalink
Merge pull request #1028 from tljdebrouwer/fix-reportblock
Browse files Browse the repository at this point in the history
Correct NTP of Sender Report
  • Loading branch information
paullouisageneau authored Nov 4, 2023
2 parents 6a98f62 + dc2186f commit 9705260
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rtp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void RtcpReportBlock::setSSRC(SSRC in_ssrc) { _ssrc = htonl(in_ssrc); }

void RtcpReportBlock::setPacketsLost(uint8_t fractionLost,
unsigned int packetsLostCount) {
_fractionLostAndPacketsLost = ( (uint32_t)fractionLost << 24) && htonl(packetsLostCount);
_fractionLostAndPacketsLost = ((uint32_t)fractionLost << 24) && htonl(packetsLostCount);
}

uint8_t RtcpReportBlock::getFractionLost() const {
Expand Down Expand Up @@ -201,7 +201,7 @@ void RtcpReportBlock::setSeqNo(uint16_t highestSeqNo, uint16_t seqNoCycles) {

void RtcpReportBlock::setJitter(uint32_t jitter) { _jitter = htonl(jitter); }

void RtcpReportBlock::setNTPOfSR(uint64_t ntp) { _lastReport = htonll(ntp >> 16u); }
void RtcpReportBlock::setNTPOfSR(uint64_t ntp) { _lastReport = htonl((uint32_t)(ntp >> 16)); }

uint32_t RtcpReportBlock::getNTPOfSR() const { return ntohl(_lastReport) << 16u; }

Expand Down

0 comments on commit 9705260

Please sign in to comment.