diff options
Diffstat (limited to 'main/format_cache.c')
-rw-r--r-- | main/format_cache.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/main/format_cache.c b/main/format_cache.c index b4d426092..c704f1c37 100644 --- a/main/format_cache.c +++ b/main/format_cache.c @@ -218,6 +218,11 @@ struct ast_format *ast_format_siren7; struct ast_format *ast_format_opus; /*! + * \brief Built-in cached codec2 format. + */ +struct ast_format *ast_format_codec2; + +/*! * \brief Built-in cached t140 format. */ struct ast_format *ast_format_t140; @@ -328,6 +333,7 @@ static void format_cache_shutdown(void) ao2_replace(ast_format_testlaw, NULL); ao2_replace(ast_format_g719, NULL); ao2_replace(ast_format_opus, NULL); + ao2_replace(ast_format_codec2, NULL); ao2_replace(ast_format_jpeg, NULL); ao2_replace(ast_format_png, NULL); ao2_replace(ast_format_h261, NULL); @@ -360,7 +366,9 @@ int ast_format_cache_init(void) static void set_cached_format(const char *name, struct ast_format *format) { - if (!strcmp(name, "g723")) { + if (!strcmp(name, "codec2")) { + ao2_replace(ast_format_codec2, format); + } else if (!strcmp(name, "g723")) { ao2_replace(ast_format_g723, format); } else if (!strcmp(name, "ulaw")) { ao2_replace(ast_format_ulaw, format); |