summaryrefslogtreecommitdiff
path: root/main/sorcery.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/sorcery.c')
-rw-r--r--main/sorcery.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/main/sorcery.c b/main/sorcery.c
index 9488dee4b..85a699bcb 100644
--- a/main/sorcery.c
+++ b/main/sorcery.c
@@ -43,7 +43,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/taskprocessor.h"
#include "asterisk/threadpool.h"
#include "asterisk/json.h"
-#include "asterisk/format_pref.h"
/* To prevent DEBUG_FD_LEAKS from interfering with things we undef open and close */
#undef open
@@ -233,10 +232,9 @@ static int chararray_handler_fn(const void *obj, const intptr_t *args, char **bu
static int codec_handler_fn(const void *obj, const intptr_t *args, char **buf)
{
- char tmp_buf[256];
- struct ast_codec_pref *pref = (struct ast_codec_pref *)(obj + args[0]);
- ast_codec_pref_string(pref, tmp_buf, sizeof(tmp_buf));
- return !(*buf = ast_strdup(tmp_buf));
+ struct ast_str *codec_buf = ast_str_alloca(64);
+ struct ast_format_cap **cap = (struct ast_format_cap **)(obj + args[0]);
+ return !(*buf = ast_strdup(ast_format_cap_get_names(*cap, &codec_buf)));
}
static sorcery_field_handler sorcery_field_default_handler(enum aco_option_type type)