Sfoglia il codice sorgente

Use the OR operator and clarify the calculation of fractionLostAndPacketsLost

Co-authored-by: Paul-Louis Ageneau <[email protected]>
ognkrmms 1 anno fa
parent
commit
45ff323b50
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      src/rtp.cpp

+ 1 - 1
src/rtp.cpp

@@ -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 {