summaryrefslogtreecommitdiff
path: root/main/codec_builtin.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/codec_builtin.c')
-rw-r--r--main/codec_builtin.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/main/codec_builtin.c b/main/codec_builtin.c
index d7d253ab8..d3f65174c 100644
--- a/main/codec_builtin.c
+++ b/main/codec_builtin.c
@@ -38,6 +38,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/format_cache.h"
#include "asterisk/frame.h"
+int __ast_codec_register_with_format(struct ast_codec *codec, const char *format_name,
+ struct ast_module *mod);
+
enum frame_type {
TYPE_HIGH, /* 0x0 */
TYPE_LOW, /* 0x1 */
@@ -774,8 +777,7 @@ static struct ast_codec t140 = {
int __res_ ## __LINE__ = 0; \
struct ast_format *__fmt_ ## __LINE__; \
struct ast_codec *__codec_ ## __LINE__; \
- codec.format_name = (codec).name; \
- res |= __ast_codec_register(&(codec), NULL); \
+ res |= __ast_codec_register_with_format(&(codec), (codec).name, NULL); \
__codec_ ## __LINE__ = ast_codec_get((codec).name, (codec).type, (codec).sample_rate); \
__fmt_ ## __LINE__ = __codec_ ## __LINE__ ? ast_format_create(__codec_ ## __LINE__) : NULL; \
res |= ast_format_cache_set(__fmt_ ## __LINE__); \
@@ -789,8 +791,7 @@ static struct ast_codec t140 = {
int __res_ ## __LINE__ = 0; \
struct ast_format *__fmt_ ## __LINE__; \
struct ast_codec *__codec_ ## __LINE__; \
- codec.format_name = fmt_name; \
- res |= __ast_codec_register(&(codec), NULL); \
+ res |= __ast_codec_register_with_format(&(codec), fmt_name, NULL); \
__codec_ ## __LINE__ = ast_codec_get((codec).name, (codec).type, (codec).sample_rate); \
__fmt_ ## __LINE__ = ast_format_create_named((fmt_name), __codec_ ## __LINE__); \
res |= ast_format_cache_set(__fmt_ ## __LINE__); \