diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2009-05-01 15:13:01 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2009-05-01 15:13:01 +0000 |
commit | ebb7fd30a96ab0cf3312181ab2add09f6cc5707e (patch) | |
tree | 0eb99d7599e9a076a22a566292e3fc196ca5feee /pjmedia/src | |
parent | 48c9710604c5e747d97992f325c4bf94fbc53376 (diff) |
Ticket #762: Fixed jitter buffer in handling DTX with relative short period of 'keep alive', e.g: Speex DTX seems to periodically send a keep alive frame every 20 silence frames.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2672 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/src')
-rw-r--r-- | pjmedia/src/pjmedia/jbuf.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/pjmedia/src/pjmedia/jbuf.c b/pjmedia/src/pjmedia/jbuf.c index 1149503b..1df68a57 100644 --- a/pjmedia/src/pjmedia/jbuf.c +++ b/pjmedia/src/pjmedia/jbuf.c @@ -315,10 +315,6 @@ static pj_status_t jb_framelist_put_at(jb_framelist_t *framelist, assert(frame_size <= framelist->frame_size); - /* the first ever frame since inited/resetted. */ - if (framelist->origin == INVALID_OFFSET) - framelist->origin = index; - /* too late or duplicated or sequence restart */ if (index < framelist->origin) { if (framelist->origin - index < MAX_MISORDER) { @@ -330,6 +326,11 @@ static pj_status_t jb_framelist_put_at(jb_framelist_t *framelist, } } + /* if jbuf is empty, just reset the origin */ + if (framelist->size == 0) { + framelist->origin = index; + } + /* get distance of this frame to the first frame in the buffer */ distance = index - framelist->origin; @@ -341,14 +342,8 @@ static pj_status_t jb_framelist_put_at(jb_framelist_t *framelist, framelist->origin = index; distance = 0; } else { - if (framelist->size == 0) { - /* if jbuf is empty, process the frame */ - framelist->origin = index; - distance = 0; - } else { - /* otherwise, reject the frame */ - return PJ_ETOOMANY; - } + /* otherwise, reject the frame */ + return PJ_ETOOMANY; } } |