[Asterisk-code-review] ast format cap: Avoid format creation on module load, use ca... (asterisk[13])
Matt Jordan
asteriskteam at digium.com
Wed Nov 11 08:07:58 CST 2015
Matt Jordan has submitted this change and it was merged.
Change subject: ast_format_cap: Avoid format creation on module load, use cache instead.
......................................................................
ast_format_cap: Avoid format creation on module load, use cache instead.
Since Asterisk 13, formats are immutable and cached. However while loading a
module like chan_sip, some formats were created instead using cached ones.
ASTERISK-25535 #close
Change-Id: I479cdc220d5617c840a98f3389b3bd91e91fbd9b
---
M main/format_cap.c
1 file changed, 4 insertions(+), 1 deletion(-)
Approvals:
Anonymous Coward #1000019: Verified
Matt Jordan: Looks good to me, approved
Joshua Colp: Looks good to me, but someone else must approve
diff --git a/main/format_cap.c b/main/format_cap.c
index 1725e38..4739efa 100644
--- a/main/format_cap.c
+++ b/main/format_cap.c
@@ -264,7 +264,10 @@
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) {
--
To view, visit https://gerrit.asterisk.org/1590
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I479cdc220d5617c840a98f3389b3bd91e91fbd9b
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
More information about the asterisk-code-review
mailing list