summaryrefslogtreecommitdiff
path: root/pjmedia
diff options
context:
space:
mode:
Diffstat (limited to 'pjmedia')
-rw-r--r--pjmedia/src/pjmedia/jbuf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pjmedia/src/pjmedia/jbuf.c b/pjmedia/src/pjmedia/jbuf.c
index dd530e99..f7ba2c95 100644
--- a/pjmedia/src/pjmedia/jbuf.c
+++ b/pjmedia/src/pjmedia/jbuf.c
@@ -648,6 +648,10 @@ PJ_INLINE(void) jbuf_update(pjmedia_jbuf *jb, int oper)
*/
if (++jb->jb_init_cycle_cnt >= INIT_CYCLE && oper == JB_OP_GET) {
jb->jb_status = JB_STATUS_PROCESSING;
+ /* To make sure the burst calculation will be done right after
+ * this, adjust burst level if it exceeds max burst level.
+ */
+ jb->jb_level = PJ_MIN(jb->jb_level, jb->jb_max_burst);
} else {
jb->jb_level = 0;
return;
@@ -660,7 +664,7 @@ PJ_INLINE(void) jbuf_update(pjmedia_jbuf *jb, int oper)
* the GET op may be idle, in this case, we better skip the jitter
* calculation.
*/
- if (oper == JB_OP_GET && jb->jb_level < jb->jb_max_burst)
+ if (oper == JB_OP_GET && jb->jb_level <= jb->jb_max_burst)
jbuf_calculate_jitter(jb);
jb->jb_level = 0;