[asterisk-commits] format: Register format-attribute module with cached formats. (asterisk[13])
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Nov 17 14:35:06 CST 2015
Matt Jordan has submitted this change and it was merged.
Change subject: format: Register format-attribute module with cached formats.
......................................................................
format: Register format-attribute module with cached formats.
In Asterisk 13, cached formats are created before their corresponding format-
attribute module is registered. Cached formats are involved when a local
extension is called. Therefore, ast_format_generate_sdp_fmtp did not work
on local extensions. This change affects the Opus Codec, H.263 (Plus), H.264,
and format-attribute modules provided externally.
ASTERISK-25160 #close
Change-Id: I1ea1f0483e5261e2a050112e4ebdfc22057d1354
---
M main/format.c
1 file changed, 20 insertions(+), 2 deletions(-)
Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
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.c b/main/format.c
index 8ac82f0..5bf38df 100644
--- a/main/format.c
+++ b/main/format.c
@@ -302,6 +302,14 @@
{
const struct ast_format_interface *interface = format->interface;
+ if (!interface) {
+ struct format_interface *format_interface = ao2_find(interfaces, format->codec->name, OBJ_SEARCH_KEY);
+ if (format_interface) {
+ interface = format_interface->interface;
+ ao2_ref(format_interface, -1);
+ }
+ }
+
if (!interface || !interface->format_attribute_get) {
return NULL;
}
@@ -330,11 +338,21 @@
void ast_format_generate_sdp_fmtp(const struct ast_format *format, unsigned int payload, struct ast_str **str)
{
- if (!format->interface || !format->interface->format_generate_sdp_fmtp) {
+ const struct ast_format_interface *interface = format->interface;
+
+ if (!interface) {
+ struct format_interface *format_interface = ao2_find(interfaces, format->codec->name, OBJ_SEARCH_KEY);
+ if (format_interface) {
+ interface = format_interface->interface;
+ ao2_ref(format_interface, -1);
+ }
+ }
+
+ if (!interface || !interface->format_generate_sdp_fmtp) {
return;
}
- format->interface->format_generate_sdp_fmtp(format, payload, str);
+ interface->format_generate_sdp_fmtp(format, payload, str);
}
struct ast_codec *ast_format_get_codec(const struct ast_format *format)
--
To view, visit https://gerrit.asterisk.org/1601
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1ea1f0483e5261e2a050112e4ebdfc22057d1354
Gerrit-PatchSet: 3
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: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
More information about the asterisk-commits
mailing list