[asterisk-dev] Re: jitterbuffer.c - small bug ?

Steve Kann stevek at stevek.com
Thu Feb 16 11:08:26 MST 2006


Doru Petrescu wrote:

>hi,
>
>I think I found s small problem in jutterbuffer.c on line 161, inside
>function history_put().
>
>here are lines 161 to 163:
>
>        kicked = jb->history[jb->hist_ptr & JB_HISTORY_SZ];
>
>        jb->history[(jb->hist_ptr++) % JB_HISTORY_SZ] = delay;
>
>"jb->hist_ptr & JB_HISTORY_SZ" shouldn't be '%' rather than '&' ?
>
>notice that the next line (163) does this correctly.
>
>Best regards,
>Doru Petrescu
>
>
>
>  
>
That's a good point.  Originally, I think we were trying to make the 
sizes powers of two, and using a mask there, but that's definitely 
incorrect..

This would cause us to not recalculate historical jitter at the right 
times..

I'll put a patch into mantis later today for this..

-SteveK




More information about the asterisk-dev mailing list