Commit e1369686 authored by Simon Morlat's avatar Simon Morlat

fixes for RTCP SR without report block.

parent cb6bd1b8
......@@ -63,7 +63,7 @@ const rtcp_common_header_t * rtcp_get_common_header(const mblk_t *m){
bool_t rtcp_is_SR(const mblk_t *m){
const rtcp_common_header_t *ch=rtcp_get_common_header(m);
if (ch!=NULL && rtcp_common_header_get_packet_type(ch)==RTCP_SR){
if (msgdsize(m)<sizeof(rtcp_sr_t)){
if (msgdsize(m)<(sizeof(rtcp_sr_t)-sizeof(report_block_t))){
ortp_warning("Too short RTCP SR packet.");
return FALSE;
}
......
......@@ -1085,7 +1085,8 @@ static void process_rtcp_packet( RtpSession *session, mblk_t *block ) {
/* compound rtcp packet can be composed by more than one rtcp message */
do{
struct timeval reception_date;
const report_block_t *rb;
/* Getting the reception date from the main clock */
gettimeofday( &reception_date, NULL );
......@@ -1114,9 +1115,10 @@ static void process_rtcp_packet( RtpSession *session, mblk_t *block ) {
/* This value will help in processing the DLSR of the next RTCP report ( see report_block_init() in rtcp.cc ) */
rtpstream->last_rcv_SR_time.tv_usec = reception_date.tv_usec;
rtpstream->last_rcv_SR_time.tv_sec = reception_date.tv_sec;
compute_rtt(session,&reception_date,&sr->rb[0]);
rb=rtcp_SR_get_report_block(block,0);
compute_rtt(session,&reception_date,rb);
}else if ( rtcp_is_RR(block)){
const report_block_t *rb=rtcp_RR_get_report_block(block,0);
rb=rtcp_RR_get_report_block(block,0);
if (rb) compute_rtt(session,&reception_date,rb);
}
}while (rtcp_next_packet(block));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment