aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-12-02 18:00:27 +0000
committertwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-12-02 18:00:27 +0000
commitca3b6ffc2fb4b8cbf0699179971af8f425195e42 (patch)
treee6a12fc1e17af6752f8901933ea42bc38d01866e
parent854e2664a7e7b28ab8ce32193f61fce28d2b670b (diff)
Initialize offset for adaptive jitter buffer
When the adaptive jitter buffer is enabled in sip.conf, the first frame placed in the jitter buffer fails with something like: jb_warning_output: Resyncing the jb. last_delay 0, this delay -215886466, threshold 1000, new offset 215886466 This happens because the offset is not initialized before calling jb_put(). This patch modifies jb_put_first_adaptive() to set the offset to the frame's timestamp. Review: https://reviewboard.asterisk.org/r/1041/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@297310 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/abstract_jb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/abstract_jb.c b/main/abstract_jb.c
index ecc5e8cde..c4f7aeefc 100644
--- a/main/abstract_jb.c
+++ b/main/abstract_jb.c
@@ -752,6 +752,11 @@ static void jb_destroy_adaptive(void *jb)
static int jb_put_first_adaptive(void *jb, struct ast_frame *fin, long now)
{
+ jitterbuf *adaptivejb = (jitterbuf *) jb;
+
+ /* Initialize the offset to that of the first frame's timestamp */
+ adaptivejb->info.resync_offset = fin->ts;
+
return jb_put_adaptive(jb, fin, now);
}