diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-07-22 12:45:37 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-07-22 12:45:37 +0000 |
commit | d08744138d7163b2dfbf05994055bf3630f9e588 (patch) | |
tree | 9091793551b24638c8bc954bcbfb227c083662ab /pjmedia | |
parent | 79fb1f6c05b421331ebf97296572ccb48cc6a78e (diff) |
Added PJMEDIA_RTCP_IGNORE_FIRST_PACKETS macro to let application decides how many first RTP packets to ignore when calculating jitter
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@618 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia')
-rw-r--r-- | pjmedia/include/pjmedia/config.h | 14 | ||||
-rw-r--r-- | pjmedia/src/pjmedia/rtcp.c | 4 |
2 files changed, 17 insertions, 1 deletions
diff --git a/pjmedia/include/pjmedia/config.h b/pjmedia/include/pjmedia/config.h index f97fb79f..9e4621d2 100644 --- a/pjmedia/include/pjmedia/config.h +++ b/pjmedia/include/pjmedia/config.h @@ -146,6 +146,20 @@ /** + * Tell RTCP to ignore the first N packets when calculating the + * jitter statistics. From experimentation, the first few packets + * (25 or so) have relatively big jitter, possibly because during + * this time, the program is also busy setting up the signaling, + * so they make the average jitter big. + * + * Default: 25. + */ +#ifndef PJMEDIA_RTCP_IGNORE_FIRST_PACKETS +# define PJMEDIA_RTCP_IGNORE_FIRST_PACKETS 25 +#endif + + +/** * G.711 Appendix I Packet Lost Concealment (PLC). * Enabled only when floating point is enabled. */ diff --git a/pjmedia/src/pjmedia/rtcp.c b/pjmedia/src/pjmedia/rtcp.c index 63f84738..f43cc2cf 100644 --- a/pjmedia/src/pjmedia/rtcp.c +++ b/pjmedia/src/pjmedia/rtcp.c @@ -274,7 +274,9 @@ PJ_DEF(void) pjmedia_rtcp_rx_rtp(pjmedia_rtcp_session *sess, /* Ignore the first N packets as they normally have bad jitter * due to other threads working to establish the call */ - if (sess->transit == 0 || sess->received < 25 ) { + if (sess->transit == 0 || + sess->received < PJMEDIA_RTCP_IGNORE_FIRST_PACKETS) + { sess->transit = transit; sess->stat.rx.jitter.min = 2000; } else { |