[asterisk-bugs] [Asterisk 0015762]: [patch] Frame.c adjustment for Speex

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Jun 1 10:46:40 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15762 
====================================================================== 
Reported By:                nblasgen
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   15762
Category:                   General
Reproducibility:            always
Severity:                   tweak
Priority:                   normal
Status:                     ready for review
Asterisk Version:           1.4.26.1 
JIRA:                       SWP-1145 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-08-23 13:02 CDT
Last Modified:              2010-06-01 10:46 CDT
====================================================================== 
Summary:                    [patch] Frame.c adjustment for Speex
Description: 
In function speex_samples, there is a test for the number of remaining
bits.

if ((len * 8 - bit) < 5) { ... }

The Speex docs (http://speex.org/docs/manual/speex-manual.ps) say in
Section 5.5 that:

"In cases where the number of frames is not determined by an out-of-band
mechanism, it is possible to include a terminator code. That terminator
consists of the code 15 (decimal) encoded with 5 bits, as shown in Table
9.2. Note that as of version 1.0.2, calling speex_bits_write automatically
inserts the terminator so as to fill the last byte. This doesn’t involves
any overhead and makes sure Speex can always detect when there is no more
frame in a packet."

Your code makes this terminator a requirement when 0 bits is also allowed,
though it might not be suggested.  I propose to add an extra line saying
the following:

if ((len * 8 - bit) == 0)
    break;
else if ((len * 8 - bit) < 5) {
    ...
}
====================================================================== 

---------------------------------------------------------------------- 
 (0122696) pabelanger (manager) - 2010-06-01 10:46
 https://issues.asterisk.org/view.php?id=15762#c122696 
---------------------------------------------------------------------- 
Upload patch based on reporters comments.  It seems like a redundant if
statement to me. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-06-01 10:46 pabelanger     Note Added: 0122696                          
======================================================================




More information about the asterisk-bugs mailing list