[Asterisk-Dev] Fixed jitterbuffer bug

Steve Kann stevek at stevek.com
Mon May 16 14:55:42 MST 2005


Bryce Nesbitt (mailing list account) wrote:

> I'm attempting to set a fixed sized jitter buffer:
>
> jitterbuffer=yes
> maxjitterbuffer=150
> maxexcessbuffer=150
> minexcessbuffer=150
> jittershrinkrate=0
>
> Looking in "channels/chan_iax2.c", though, it appears that the jitter
> buffer code will step the jitterbuffer under certain circumstances,
> ignoring the maximum and minimum buffer sizes:
>
> // max and min refers to received packet spread
> // max_jitter_buffer is set to maxexcessbuffer
> // min_jitter_buffer is set to minexcessbuffer
>
> if (max < iaxs[fr->callno]->jitterbuffer - max_jitter_buffer)
> iaxs[fr->callno]->jitterbuffer -= jittershrinkrate;
>
> if (max > iaxs[fr->callno]->jitterbuffer - min_jitter_buffer)
> iaxs[fr->callno]->jitterbuffer += jittershrinkrate;
>
> if (max > iaxs[fr->callno]->jitterbuffer)
> iaxs[fr->callno]->jitterbuffer = max;
>
> This the last line of this code snippet a bug? Stepping the 
> jitterbuffer size
> would seem to risk an audible artifact.


You probably want to look at the new jittebuffer instead of the old one. 
The old _always_ gives audible artifacts whenever it grows or shrinks -- 
especially when it grows, as the "gaps" are [effectively] filled with 
silence.

-SteveK




More information about the asterisk-dev mailing list