Skip to content

Commit

Permalink
Use the OR operator and clarify the calculation of fractionLostAndPac…
Browse files Browse the repository at this point in the history
…ketsLost

Co-authored-by: Paul-Louis Ageneau <[email protected]>
  • Loading branch information
ognkrmms and paullouisageneau authored Dec 11, 2023
1 parent d23ad4b commit 45ff323
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 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 = htonl((uint32_t(fractionLost) << 24) | (packetsLostCount & 0xFFFFFF));
}

uint8_t RtcpReportBlock::getFractionLost() const {
Expand Down

0 comments on commit 45ff323

Please sign in to comment.