summaryrefslogtreecommitdiff
path: root/pjmedia
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2009-03-04 14:53:12 +0000
committerBenny Prijono <bennylp@teluu.com>2009-03-04 14:53:12 +0000
commit42ee8666dff7f9689ea1ff50409d5170a8417838 (patch)
tree539785d1863eca5d0fd29f21d1d2ed7aee26951c /pjmedia
parentd33a9e7ea8dfd4afbe02d62c2180636f5e9f1a94 (diff)
Ticket #744: Jitter buffer does not discard duplicate frame if it is currently empty (thanks Mårten Wikström for the report)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2485 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia')
-rw-r--r--pjmedia/src/pjmedia/jbuf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/pjmedia/src/pjmedia/jbuf.c b/pjmedia/src/pjmedia/jbuf.c
index c9a47f29..2cbb1643 100644
--- a/pjmedia/src/pjmedia/jbuf.c
+++ b/pjmedia/src/pjmedia/jbuf.c
@@ -267,6 +267,13 @@ static pj_bool_t jb_framelist_put_at(jb_framelist_t *framelist,
framelist->flist_max_count;
}
} else {
+ // check if frame is not too late, but watch out for sequence restart.
+ if (index < framelist->flist_origin &&
+ framelist->flist_origin - index < 0x7FFF)
+ {
+ return PJ_FALSE;
+ }
+
where = framelist->flist_tail;
framelist->flist_origin = index;
framelist->flist_tail = (framelist->flist_tail + 1) %