Merge "ast_format_cap: Avoid format creation on module load, use cache instead."

This commit is contained in:
Matt Jordan 2015-11-11 08:08:02 -06:00 committed by Gerrit Code Review
commit 7987bf54c6
1 changed files with 4 additions and 1 deletions

View File

@ -230,7 +230,10 @@ int ast_format_cap_append_by_type(struct ast_format_cap *cap, enum ast_media_typ
continue;
}
format = ast_format_create(codec);
format = ast_format_cache_get(codec->name);
if (!format || (codec != ast_format_get_codec(format))) {
format = ast_format_create(codec);
}
ao2_ref(codec, -1);
if (!format) {