diff options
Diffstat (limited to 'pjmedia')
-rw-r--r-- | pjmedia/include/pjmedia/stream.h | 5 | ||||
-rw-r--r-- | pjmedia/src/pjmedia/session.c | 4 | ||||
-rw-r--r-- | pjmedia/src/pjmedia/stream.c | 15 |
3 files changed, 16 insertions, 8 deletions
diff --git a/pjmedia/include/pjmedia/stream.h b/pjmedia/include/pjmedia/stream.h index 05007dc4..41f690bd 100644 --- a/pjmedia/include/pjmedia/stream.h +++ b/pjmedia/include/pjmedia/stream.h @@ -76,9 +76,8 @@ struct pjmedia_stream_info int tx_event_pt;/**< Outgoing pt for telephone-events. */ int rx_event_pt;/**< Incoming pt for telephone-events. */ pj_uint32_t ssrc; /**< RTP SSRC. */ - int jb_min; /**< Jitter buffer min delay. */ - int jb_max; /**< Jitter buffer max delay. */ - int jb_maxcnt; /**< Jitter buffer max delay. */ + int jb_init; /**< Jitter buffer init delay in msec. */ + int jb_max; /**< Jitter buffer max delay in msec. */ }; diff --git a/pjmedia/src/pjmedia/session.c b/pjmedia/src/pjmedia/session.c index fa62136f..c09926b8 100644 --- a/pjmedia/src/pjmedia/session.c +++ b/pjmedia/src/pjmedia/session.c @@ -24,6 +24,7 @@ #include <pj/string.h> #include <pj/assert.h> #include <pj/ctype.h> +#include <pj/rand.h> struct pjmedia_session @@ -334,7 +335,8 @@ PJ_DEF(pj_status_t) pjmedia_stream_info_from_sdp( } - /* Leave SSRC to zero. */ + /* Leave SSRC to random. */ + si->ssrc = pj_rand(); /* Leave jitter buffer parameter. */ diff --git a/pjmedia/src/pjmedia/stream.c b/pjmedia/src/pjmedia/stream.c index b35b54c5..d7a38df4 100644 --- a/pjmedia/src/pjmedia/stream.c +++ b/pjmedia/src/pjmedia/stream.c @@ -901,10 +901,17 @@ PJ_DEF(pj_status_t) pjmedia_stream_create( pjmedia_endpt *endpt, /* Create jitter buffer: */ - jbuf_init = 100 / (stream->port.info.samples_per_frame * 1000 / - info->fmt.clock_rate); - jbuf_max = 600 / (stream->port.info.samples_per_frame * 1000 / - info->fmt.clock_rate); + if (info->jb_init) + jbuf_init = info->jb_init; + else + jbuf_init = 60 / (stream->port.info.samples_per_frame * 1000 / + info->fmt.clock_rate); + + if (info->jb_max) + jbuf_max = info->jb_max; + else + jbuf_max = 240 / (stream->port.info.samples_per_frame * 1000 / + info->fmt.clock_rate); status = pjmedia_jbuf_create(pool, &stream->port.info.name, stream->frame_size, jbuf_init, jbuf_max, |