From d94bb98beca8a6eaf31ed889a172eca06045fedc Mon Sep 17 00:00:00 2001 From: dvossel Date: Thu, 7 Jul 2011 19:39:17 +0000 Subject: Adds pass-through support for codec CELT. This patch adds pass-through support for CELT. CELT formats are defined in codecs.conf and can be configured to any sample rate a CELT endpoint supports. This patch also addresses a crash in channel.c resulting from a frame list being freed incorrectly. This crash was discovered while testing a CELT translator which had to split encoded audio into multiple frames. The codec translator is not a part of this patch, but may be contributed in the future. Review: https://reviewboard.asterisk.org/r/1294/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@326855 f38db490-d61c-443f-a65b-d21fe96a405b --- main/frame.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'main/frame.c') diff --git a/main/frame.c b/main/frame.c index bb32386ca..b664e2e84 100644 --- a/main/frame.c +++ b/main/frame.c @@ -1011,6 +1011,10 @@ int ast_codec_get_samples(struct ast_frame *f) } else { return 160; } + case AST_FORMAT_CELT: + /* TODO The assumes 20ms delivery right now, which is incorrect */ + samples = ast_format_rate(&f->subclass.format) / 50; + break; default: ast_log(LOG_WARNING, "Unable to calculate samples for format %s\n", ast_getformatname(&f->subclass.format)); } -- cgit v1.2.3