Browse Source

Merge pull request #1069 from vagonhq/fix-setPacketsLost

Fix RtcpReportBlock::setPacketsLost()
Paul-Louis Ageneau 1 year ago
parent
commit
a1078c5029
1 changed files with 1 additions and 1 deletions
  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,
 void RtcpReportBlock::setPacketsLost(uint8_t fractionLost,
                                      unsigned int packetsLostCount) {
                                      unsigned int packetsLostCount) {
-	_fractionLostAndPacketsLost = ((uint32_t)fractionLost << 24) && htonl(packetsLostCount);
+	_fractionLostAndPacketsLost = htonl((uint32_t(fractionLost) << 24) | (packetsLostCount & 0xFFFFFF));
 }
 }
 
 
 uint8_t RtcpReportBlock::getFractionLost() const {
 uint8_t RtcpReportBlock::getFractionLost() const {