diff options
author | Kevin Harwell <kharwell@digium.com> | 2017-01-12 15:58:43 -0600 |
---|---|---|
committer | Kevin Harwell <kharwell@digium.com> | 2017-01-17 17:08:53 -0600 |
commit | 283c16c6b6136dfdb13b4fa6b524126e7aab1dfc (patch) | |
tree | 7d10831c547c294f629e7691295f244e8049bacf /main/fixedjitterbuf.c | |
parent | f4e77a5678ac8babeff853988941bf821b5d23cf (diff) |
abstract/fixed/adpative jitter buffer: disallow frame re-inserts
It was possible for a frame to be re-inserted into a jitter buffer after it
had been removed from it. A case when this happened was if a frame was read
out of the jitterbuffer, passed to the translation core, and then multiple
frames were returned from said translation core. Upon multiple frames being
returned the first is passed on, but sebsequently "chained" frames are put
back into the read queue. Thus it was possible for a frame to go back into
the jitter buffer where this would cause problems.
This patch adds a flag to frames that are inserted into the channel's read
queue after translation. The abstract jitter buffer code then checks for this
flag and ignores any frames marked as such.
Change-Id: I276c44edc9dcff61e606242f71274265c7779587
Diffstat (limited to 'main/fixedjitterbuf.c')
-rw-r--r-- | main/fixedjitterbuf.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/main/fixedjitterbuf.c b/main/fixedjitterbuf.c index fc3e8cb66..3c350b4bc 100644 --- a/main/fixedjitterbuf.c +++ b/main/fixedjitterbuf.c @@ -194,7 +194,6 @@ int fixed_jb_put_first(struct fixed_jb *jb, void *data, long ms, long ts, long n return fixed_jb_put(jb, data, ms, ts, now); } - int fixed_jb_put(struct fixed_jb *jb, void *data, long ms, long ts, long now) { struct fixed_jb_frame *frame, *next, *newframe; @@ -347,3 +346,8 @@ int fixed_jb_remove(struct fixed_jb *jb, struct fixed_jb_frame *frameout) return FIXED_JB_OK; } + +int fixed_jb_is_late(struct fixed_jb *jb, long ts) +{ + return jb->rxcore + jb->delay + ts < jb->next_delivery; +} |