[Home]

Summary:ASTERISK-06342: [PATCH] bitwise and used instead of modulus in indexing history in jitterbuffer history recalculation
Reporter:stevekstevek (stevekstevek)Labels:
Date Opened:2006-02-16 15:04:10.000-0600Date Closed:2008-01-15 16:51:08.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_iax2
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) jb.patch
Description:
As reported on asterisk-dev.  This error could conceviably cause incorrect jitter calculations.  I'm not sure if it actually does do that, though.  (Previously, the history was always a power of 2, and we did bitwise-and with a mask, but when that was changed, this bug was created).

one-character patch included.

disclaimer on file.

batteries not included.


Subject: jitterbuffer.c - small bug ?
From: Doru Petrescu <pdoru.asterisk@from.ro>
To: asterisk-dev@lists.digium.com
Date: Thu, 16 Feb 2006 14:28:08 +0200

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


****** STEPS TO REPRODUCE ******

Examine source code.  Notice error.  
Comments:By: Russell Bryant (russell) 2006-02-16 19:01:07.000-0600

fixed in the 1.2 branch and trunk in revisions 10368 and 10369, thanks!

By: Digium Subversion (svnbot) 2008-01-15 16:51:07.000-0600

Repository: asterisk
Revision: 10368

U   branches/1.2/jitterbuf.c

------------------------------------------------------------------------
r10368 | russell | 2008-01-15 16:51:06 -0600 (Tue, 15 Jan 2008) | 2 lines

fix incorrent index calculation for jitterbuffer history (issue ASTERISK-6342)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=10368

By: Digium Subversion (svnbot) 2008-01-15 16:51:08.000-0600

Repository: asterisk
Revision: 10369

_U  trunk/
U   trunk/jitterbuf.c

------------------------------------------------------------------------
r10369 | russell | 2008-01-15 16:51:07 -0600 (Tue, 15 Jan 2008) | 10 lines

Merged revisions 10368 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r10368 | russell | 2006-02-16 20:55:10 -0500 (Thu, 16 Feb 2006) | 2 lines

fix incorrent index calculation for jitterbuffer history (issue ASTERISK-6342)

........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=10369