Index: rtp.c =================================================================== --- rtp.c (revision 37320) +++ rtp.c (working copy) @@ -1047,7 +1047,7 @@ rtp->seedrxseqno = seqno; } - if (rtp->rtcp->schedid < 1) { + if (rtp->rtcp && rtp->rtcp->schedid < 1) { /* Schedule transmission of Receiver Report */ rtp->rtcp->schedid = ast_sched_add(rtp->sched, ast_rtcp_calc_interval(rtp), ast_rtcp_write, rtp); } @@ -1744,7 +1744,7 @@ void ast_rtp_stop(struct ast_rtp *rtp) { - if (rtp->rtcp->schedid > 0) { + if (rtp->rtcp && rtp->rtcp->schedid > 0) { ast_sched_del(rtp->sched, rtp->rtcp->schedid); rtp->rtcp->schedid = -1; } @@ -1816,11 +1816,6 @@ ast_verbose(" RTT: %f\n", rtp->rtcp->rtt); } - if (rtp->rtcp->schedid > 0) { - ast_sched_del(rtp->sched, rtp->rtcp->schedid); - rtp->rtcp->schedid = -1; - } - if (rtp->smoother) ast_smoother_free(rtp->smoother); if (rtp->ioid) @@ -1828,6 +1823,8 @@ if (rtp->s > -1) close(rtp->s); if (rtp->rtcp) { + if (rtp->rtcp->schedid > 0) + ast_sched_del(rtp->sched, rtp->rtcp->schedid); close(rtp->rtcp->s); free(rtp->rtcp); rtp->rtcp=NULL; @@ -2289,7 +2286,7 @@ rtp->txcount++; rtp->txoctetcount +=(res - hdrlen); - if (rtp->rtcp->schedid < 1) + if (rtp->rtcp && rtp->rtcp->schedid < 1) rtp->rtcp->schedid = ast_sched_add(rtp->sched, ast_rtcp_calc_interval(rtp), ast_rtcp_write, rtp); }