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 | |
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
-rw-r--r-- | pjmedia/build/Jbtest.dat | 8 | ||||
-rw-r--r-- | pjmedia/src/pjmedia/jbuf.c | 19 |
2 files changed, 13 insertions, 14 deletions
diff --git a/pjmedia/build/Jbtest.dat b/pjmedia/build/Jbtest.dat index 6c836f07..3e2169c4 100644 --- a/pjmedia/build/Jbtest.dat +++ b/pjmedia/build/Jbtest.dat @@ -184,14 +184,18 @@ G PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG G PGPGPPGGPPPPGGPGGGPG %adaptive 0 0 10 !burst 1 !discard 0 -!lost 3 -!empty 1 +!lost 7 +!empty 3 !delay 3 PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG # Some losts LGPGPGLGPGPGPGLGPGPG # Normal PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG +# More losts +PLPGGGPPPGGGPLPGGGPG PLPGGGPPPGGGPLPGGGPG +# Normal +PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG . = Sequence restart 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; } } |