diff options
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; } } |