laforge submitted this change.

View Change

Approvals: pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, approved
twrtp: fix generation of loss info word in RTCP RR blocks

We generate RTCP SR and RR packets that include reception report blocks
describing what our twjit received - see RFC 3550 section 6.4.1. These
RR blocks include a 32-bit word that reports our receiver's detection
of packet loss in the incoming RTP stream; this word consists of an
8-bit "fraction lost" field and a 24-bit "cumulative number of packets
lost" field. Our previous code computed each of these separate fields
correctly, but the final step of combining them into the 32-bit word
applied the wrong shift, producing garbage as a result. Fix it.

Change-Id: Ib34239a4f4619fef097b4c1fb5fc3abed339850d
---
M src/twrtp.c
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/twrtp.c b/src/twrtp.c
index 1a1b7be..4d81510 100644
--- a/src/twrtp.c
+++ b/src/twrtp.c
@@ -851,7 +851,7 @@
lost_fract = 0;
else
lost_fract = (newly_lost << 8) / delta_expect;
- lost_word = (lost_fract << 8) | (cumulative_lost & 0xFFFFFF);
+ lost_word = (lost_fract << 24) | (cumulative_lost & 0xFFFFFF);

rr->ssrc = htonl(rri->ssrc);
rr->lost_word = htonl(lost_word);

To view, visit change 44027. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ib34239a4f4619fef097b4c1fb5fc3abed339850d
Gerrit-Change-Number: 44027
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon@freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>