diff options
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 { |