[asterisk-bugs] [Asterisk 0015762]: Frame.c adjustment for Speex
Asterisk Bug Tracker
noreply at bugs.digium.com
Sun Aug 23 13:02:19 CDT 2009
The following issue has been SUBMITTED.
======================================================================
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: new
Asterisk Version: 1.4.26.1
Regression: No
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: 2009-08-23 13:02 CDT
======================================================================
Summary: 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) {
...
}
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2009-08-23 13:02 nblasgen New Issue
2009-08-23 13:02 nblasgen Asterisk Version => 1.4.26.1
2009-08-23 13:02 nblasgen Regression => No
2009-08-23 13:02 nblasgen SVN Branch (only for SVN checkouts, not tarball
releases) => N/A
======================================================================
More information about the asterisk-bugs
mailing list