summaryrefslogtreecommitdiff
path: root/codecs
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-04-20 19:56:07 +0000
committerShaun Ruffell <sruffell@digium.com>2011-04-20 19:56:07 +0000
commit3b52f36551331fbae62c82e5e0f7f1a250b6c17d (patch)
tree656f99a3e3e17fdc0d0987f0947d4ba203c0aa09 /codecs
parent7adbec49a5afac98102d5660fdba138416e1ff73 (diff)
codec_dahdi: DAHDI still advertises formats using the old bitfields.
Previously, the DAHDI format bit fields matched up with the Asterisk bitfields. Since the Asterisk codec bit fields were replaced in r306010, codec_dahdi needs to contain the formats itself. In the future, the DAHDI formats should either change to something other than bitfields, or the bitfields need to move from include/dahdi/kernel.h to include/dahdi/user.h. Signed-off-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@314471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'codecs')
-rw-r--r--codecs/codec_dahdi.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/codecs/codec_dahdi.c b/codecs/codec_dahdi.c
index 960a594f7..9e15d4095 100644
--- a/codecs/codec_dahdi.c
+++ b/codecs/codec_dahdi.c
@@ -56,6 +56,20 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#define G723_SAMPLES 240
#define G729_SAMPLES 160
+#ifndef DAHDI_FORMAT_MAX_AUDIO
+#define DAHDI_FORMAT_G723_1 (1 << 0)
+#define DAHDI_FORMAT_GSM (1 << 1)
+#define DAHDI_FORMAT_ULAW (1 << 2)
+#define DAHDI_FORMAT_ALAW (1 << 3)
+#define DAHDI_FORMAT_G726 (1 << 4)
+#define DAHDI_FORMAT_ADPCM (1 << 5)
+#define DAHDI_FORMAT_SLINEAR (1 << 6)
+#define DAHDI_FORMAT_LPC10 (1 << 7)
+#define DAHDI_FORMAT_G729A (1 << 8)
+#define DAHDI_FORMAT_SPEEX (1 << 9)
+#define DAHDI_FORMAT_ILBC (1 << 10)
+#endif
+
static struct channel_usage {
int total;
int encoders;
@@ -598,13 +612,13 @@ static int find_transcoders(void)
* module. Also, do not allow direct ulaw/alaw to complex
* codec translation, since that will prevent the generic PLC
* functions from working. */
- if (info.dstfmts & (AST_FORMAT_ULAW | AST_FORMAT_ALAW)) {
- info.dstfmts |= AST_FORMAT_SLINEAR;
- info.dstfmts &= ~(AST_FORMAT_ULAW | AST_FORMAT_ALAW);
+ if (info.dstfmts & (DAHDI_FORMAT_ULAW | DAHDI_FORMAT_ALAW)) {
+ info.dstfmts |= DAHDI_FORMAT_SLINEAR;
+ info.dstfmts &= ~(DAHDI_FORMAT_ULAW | DAHDI_FORMAT_ALAW);
}
- if (info.srcfmts & (AST_FORMAT_ULAW | AST_FORMAT_ALAW)) {
- info.srcfmts |= AST_FORMAT_SLINEAR;
- info.srcfmts &= ~(AST_FORMAT_ULAW | AST_FORMAT_ALAW);
+ if (info.srcfmts & (DAHDI_FORMAT_ULAW | DAHDI_FORMAT_ALAW)) {
+ info.srcfmts |= DAHDI_FORMAT_SLINEAR;
+ info.srcfmts &= ~(DAHDI_FORMAT_ULAW | DAHDI_FORMAT_ALAW);
}
build_translators(&map, info.dstfmts, info.srcfmts);