[asterisk-commits] tilghman: branch tilghman/codec_bits3 r227496 - in /team/tilghman/codec_bits3...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Nov 3 17:15:59 CST 2009
Author: tilghman
Date: Tue Nov 3 17:15:55 2009
New Revision: 227496
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=227496
Log:
Yet more debugging
Modified:
team/tilghman/codec_bits3/channels/chan_iax2.c
team/tilghman/codec_bits3/main/frame.c
Modified: team/tilghman/codec_bits3/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/channels/chan_iax2.c?view=diff&rev=227496&r1=227495&r2=227496
==============================================================================
--- team/tilghman/codec_bits3/channels/chan_iax2.c (original)
+++ team/tilghman/codec_bits3/channels/chan_iax2.c Tue Nov 3 17:15:55 2009
@@ -6037,8 +6037,10 @@
f->frametype = fh->type;
if (f->frametype == AST_FRAME_VIDEO) {
f->subclass.codec = uncompress_subclass(fh->csub & ~0x40) | ((fh->csub >> 6) & 0x1);
+ } else if (f->frametype == AST_FRAME_VOICE) {
+ f->subclass.codec = uncompress_subclass(fh->csub);
} else {
- f->subclass.codec = uncompress_subclass(fh->csub);
+ f->subclass.integer = uncompress_subclass(fh->csub);
}
} else {
struct ast_iax2_mini_enc_hdr *efh = (struct ast_iax2_mini_enc_hdr *)fh;
@@ -9643,12 +9645,10 @@
f.frametype = fh->type;
if (f.frametype == AST_FRAME_VIDEO) {
f.subclass.codec = uncompress_subclass(fh->csub & ~0x40) | ((fh->csub >> 6) & 0x1);
+ } else if (f.frametype == AST_FRAME_VOICE) {
+ f.subclass.codec = uncompress_subclass(fh->csub);
} else {
- f.subclass.codec = uncompress_subclass(fh->csub);
- }
-
- if (f.subclass.codec == 0) {
- ast_log(LOG_WARNING, "WTF? csub of %d decoded as 0?!!\n", fh->csub);
+ f.subclass.integer = uncompress_subclass(fh->csub);
}
/* Deal with POKE/PONG without allocating a callno */
Modified: team/tilghman/codec_bits3/main/frame.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/main/frame.c?view=diff&rev=227496&r1=227495&r2=227496
==============================================================================
--- team/tilghman/codec_bits3/main/frame.c (original)
+++ team/tilghman/codec_bits3/main/frame.c Tue Nov 3 17:15:55 2009
@@ -1426,6 +1426,7 @@
int ast_codec_get_samples(struct ast_frame *f)
{
int samples = 0;
+ char tmp[64];
switch (f->subclass.codec) {
case AST_FORMAT_SPEEX:
@@ -1472,7 +1473,7 @@
samples = (int) f->datalen * ((float) 32000 / 6000);
break;
default:
- ast_log(LOG_WARNING, "Unable to calculate samples for format %s\n", ast_getformatname(f->subclass.codec));
+ ast_log(LOG_WARNING, "Unable to calculate samples for format %s\n", ast_getformatname_multiple(tmp, sizeof(tmp), f->subclass.codec));
}
return samples;
}
More information about the asterisk-commits
mailing list