Remove the constraint where Sender Report must contain Receiver Report Blocks

The session may consist of single writer and multiple readers. In this
case it must still be possible to send RTCP status reports to readers.
This commit is contained in:
Aaro Altonen 2019-06-25 11:03:41 +03:00
parent 74534494ab
commit 3868fe83d9
1 changed files with 3 additions and 7 deletions

View File

@ -70,12 +70,6 @@ rtp_error_t kvz_rtp::frame::dealloc_frame(kvz_rtp::frame::rtp_frame *frame)
kvz_rtp::frame::rtcp_sender_frame *kvz_rtp::frame::alloc_rtcp_sender_frame(size_t nblocks)
{
if (nblocks == 0) {
LOG_ERROR("Cannot send 0 report blocks!");
rtp_errno = RTP_INVALID_VALUE;
return nullptr;
}
size_t total_size =
sizeof(rtcp_header) +
sizeof(uint32_t) +
@ -98,7 +92,9 @@ kvz_rtp::frame::rtcp_sender_frame *kvz_rtp::frame::alloc_rtcp_sender_frame(size_
/* caller fills these */
memset(&frame->s_info, 0, sizeof(rtcp_sender_info));
memset(frame->blocks, 0, sizeof(rtcp_report_block) * nblocks);
if (nblocks == 0)
memset(frame->blocks, 0, sizeof(rtcp_report_block) * nblocks);
return frame;
}