From ee21eee7e067573ad83bd0df492036094b4dbaca Mon Sep 17 00:00:00 2001 From: Mark Michelson Date: Thu, 3 Oct 2013 14:58:16 +0000 Subject: Cache string values of formats on ast_format_cap() to save processing. Channel snapshots have string representations of the channel's native formats. Prior to this change, the format strings were re-created on ever channel snapshot creation. Since channel native formats rarely change, this was very wasteful. Now, string representations of formats may optionally be stored on the ast_format_cap for cases where string representations may be requested frequently. When formats are altered, the string cache is marked as invalid. When strings are requested, the cache validity is checked. If the cache is valid, then the cached strings are copied. If the cache is invalid, then the string cache is rebuilt and copied, and the cache is marked as being valid again. Review: https://reviewboard.asterisk.org/r/2879 ........ Merged revisions 400356 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400363 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_meetme.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps/app_meetme.c') diff --git a/apps/app_meetme.c b/apps/app_meetme.c index cd6a4f72c..ffd55e70d 100644 --- a/apps/app_meetme.c +++ b/apps/app_meetme.c @@ -1611,7 +1611,7 @@ static struct ast_conference *build_conf(const char *confno, const char *pin, struct ast_conference *cnf; struct dahdi_confinfo dahdic = { 0, }; int confno_int = 0; - struct ast_format_cap *cap_slin = ast_format_cap_alloc_nolock(); + struct ast_format_cap *cap_slin = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_NOLOCK); struct ast_format tmp_fmt; AST_LIST_LOCK(&confs); @@ -3216,7 +3216,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc int setusercount = 0; int confsilence = 0, totalsilence = 0; char *mailbox, *context; - struct ast_format_cap *cap_slin = ast_format_cap_alloc_nolock(); + struct ast_format_cap *cap_slin = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_NOLOCK); struct ast_format tmpfmt; if (!cap_slin) { -- cgit v1.2.3