mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-01 11:32:25 +00:00
Don't access rtp->rtcp->* if rtp->rtcp is null
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@200171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
25
main/rtp.c
25
main/rtp.c
@@ -1494,18 +1494,21 @@ static void calc_rxstamp(struct timeval *when, struct ast_rtp *rtp, unsigned int
|
||||
if (d<0)
|
||||
d=-d;
|
||||
rtp->rxjitter += (1./16.) * (d - rtp->rxjitter);
|
||||
if (rtp->rtcp && rtp->rxjitter > rtp->rtcp->maxrxjitter)
|
||||
rtp->rtcp->maxrxjitter = rtp->rxjitter;
|
||||
if (rtp->rtcp->rxjitter_count == 1)
|
||||
rtp->rtcp->minrxjitter = rtp->rxjitter;
|
||||
if (rtp->rtcp && rtp->rxjitter < rtp->rtcp->minrxjitter)
|
||||
rtp->rtcp->minrxjitter = rtp->rxjitter;
|
||||
|
||||
normdev_rxjitter_current = normdev_compute(rtp->rtcp->normdev_rxjitter,rtp->rxjitter,rtp->rtcp->rxjitter_count);
|
||||
rtp->rtcp->stdev_rxjitter = stddev_compute(rtp->rtcp->stdev_rxjitter,rtp->rxjitter,rtp->rtcp->normdev_rxjitter,normdev_rxjitter_current,rtp->rtcp->rxjitter_count);
|
||||
|
||||
rtp->rtcp->normdev_rxjitter = normdev_rxjitter_current;
|
||||
rtp->rtcp->rxjitter_count++;
|
||||
if (rtp->rtcp) {
|
||||
if (rtp->rxjitter > rtp->rtcp->maxrxjitter)
|
||||
rtp->rtcp->maxrxjitter = rtp->rxjitter;
|
||||
if (rtp->rtcp->rxjitter_count == 1)
|
||||
rtp->rtcp->minrxjitter = rtp->rxjitter;
|
||||
if (rtp->rxjitter < rtp->rtcp->minrxjitter)
|
||||
rtp->rtcp->minrxjitter = rtp->rxjitter;
|
||||
|
||||
normdev_rxjitter_current = normdev_compute(rtp->rtcp->normdev_rxjitter,rtp->rxjitter,rtp->rtcp->rxjitter_count);
|
||||
rtp->rtcp->stdev_rxjitter = stddev_compute(rtp->rtcp->stdev_rxjitter,rtp->rxjitter,rtp->rtcp->normdev_rxjitter,normdev_rxjitter_current,rtp->rtcp->rxjitter_count);
|
||||
|
||||
rtp->rtcp->normdev_rxjitter = normdev_rxjitter_current;
|
||||
rtp->rtcp->rxjitter_count++;
|
||||
}
|
||||
}
|
||||
|
||||
/*! \brief Perform a Packet2Packet RTP write */
|
||||
|
||||
Reference in New Issue
Block a user