[asterisk-commits] branch oej/test-this-branch r11380 -
/team/oej/test-this-branch/
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue Feb 28 09:46:46 MST 2006
Author: oej
Date: Tue Feb 28 10:46:44 2006
New Revision: 11380
URL: http://svn.digium.com/view/asterisk?rev=11380&view=rev
Log:
Jitterbuffer fixes from the "jitterbuffer" branch
Modified:
team/oej/test-this-branch/abstract_jb.c
team/oej/test-this-branch/scx_jitterbuf.c
Modified: team/oej/test-this-branch/abstract_jb.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/abstract_jb.c?rev=11380&r1=11379&r2=11380&view=diff
==============================================================================
--- team/oej/test-this-branch/abstract_jb.c (original)
+++ team/oej/test-this-branch/abstract_jb.c Tue Feb 28 10:46:44 2006
@@ -341,13 +341,22 @@
return -1;
}
- if(!f->has_timing_info || f->len < 2)
- {
- /* TODO: Shouldn't we disable the jb here? Or we can produce timestamp and seqno? */
+ /* We consider an enabled jitterbuffer should receive frames with valid timing info. */
+ if(!f->has_timing_info || f->len < 2 || f->ts < 0)
+ {
+ ast_log(LOG_WARNING, "Recieved frame with invalid timing info: "
+ "has_timing_info=%d, len=%ld, ts=%ld\n", f->has_timing_info, f->len, f->ts);
return -1;
}
- frr = ast_frisolate(f);
+ if(f->mallocd & AST_MALLOCD_HDR)
+ {
+ frr = ast_frdup(f);
+ }
+ else
+ {
+ frr = ast_frisolate(f);
+ }
if(frr == NULL)
{
ast_log(LOG_ERROR, "Failed to isolate frame for the jitterbuffer on channel '%s'\n", chan->name);
Modified: team/oej/test-this-branch/scx_jitterbuf.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/scx_jitterbuf.c?rev=11380&r1=11379&r2=11380&view=diff
==============================================================================
--- team/oej/test-this-branch/scx_jitterbuf.c (original)
+++ team/oej/test-this-branch/scx_jitterbuf.c Tue Feb 28 10:46:44 2006
@@ -305,8 +305,6 @@
int scx_jb_get(struct scx_jb *jb, struct scx_jb_frame *frame, long now, long interpl)
{
- long halflen;
-
assert(now >= 0);
assert(interpl >= 2);
@@ -326,10 +324,8 @@
return SCX_JB_INTERP;
}
- halflen = (long) ((double) jb->frames->ms / 2.0);
-
/* Isn't it too late for the first frame available in the jb? */
- if(now > jb->frames->delivery + halflen)
+ if(now > jb->frames->delivery + jb->frames->ms)
{
/* yes - should drop this frame and update next to point the next frame (get_jb_head() does it) */
get_jb_head(jb, frame);
@@ -338,7 +334,7 @@
}
/* isn't it too early to play the first frame available? */
- if(now < jb->frames->delivery - halflen)
+ if(now < jb->frames->delivery)
{
/* yes - should interpolate one frame */
/* update next */
More information about the asterisk-commits
mailing list