rtcp: Extract fraction and lost fields correctly from the report

This commit is contained in:
Aaro Altonen 2021-04-22 13:25:04 +03:00
parent bfaa3536c5
commit 6e53f686f9
3 changed files with 15 additions and 13 deletions

View File

@ -76,7 +76,8 @@ rtp_error_t uvgrtp::rtcp::handle_receiver_report_packet(uint8_t *packet, size_t
uvgrtp::frame::rtcp_report_block report;
report.ssrc = ntohl(*(uint32_t *)&packet[(i * 24) + 8 + 0]);
report.lost = ntohl(*(uint32_t *)&packet[(i * 24) + 8 + 4]);
report.fraction = (ntohl(*(uint32_t *)&packet[(i * 24) + 8 + 4])) >> 24;
report.lost = (ntohl(*(uint32_t *)&packet[(i * 24) + 8 + 4])) & 0xfffffd;
report.last_seq = ntohl(*(uint32_t *)&packet[(i * 24) + 8 + 8]);
report.jitter = ntohl(*(uint32_t *)&packet[(i * 24) + 8 + 12]);
report.lsr = ntohl(*(uint32_t *)&packet[(i * 24) + 8 + 16]);

View File

@ -77,7 +77,8 @@ rtp_error_t uvgrtp::rtcp::handle_sender_report_packet(uint8_t *packet, size_t si
uvgrtp::frame::rtcp_report_block report;
report.ssrc = ntohl(*(uint32_t *)&packet[(i * 24) + 28 + 0]);
report.lost = ntohl(*(uint32_t *)&packet[(i * 24) + 28 + 4]);
report.fraction = (ntohl(*(uint32_t *)&packet[(i * 24) + 28 + 4])) >> 24;
report.lost = (ntohl(*(uint32_t *)&packet[(i * 24) + 28 + 4])) & 0xfffffd;
report.last_seq = ntohl(*(uint32_t *)&packet[(i * 24) + 28 + 8]);
report.jitter = ntohl(*(uint32_t *)&packet[(i * 24) + 28 + 12]);
report.lsr = ntohl(*(uint32_t *)&packet[(i * 24) + 28 + 16]);