summaryrefslogtreecommitdiff
path: root/main/rtp_engine.c
diff options
context:
space:
mode:
authorAlexander Traud <pabstraud@compuserve.com>2015-11-10 16:24:31 +0100
committerAlexander Traud <pabstraud@compuserve.com>2015-11-11 15:00:26 +0100
commit525c7ab780b5d05ffd9196e9abcf4d3245f64f51 (patch)
tree33a6835272511798d17425a67eff903ff11ce059 /main/rtp_engine.c
parentf12ebe35848c2ce82e53b332742e83b2b5875502 (diff)
rtp_engine: Init a format-attribute module to its RFC defaults.
Previously, format-attribute modules relied on an existing fmtp line in SDP negotiation. However, fmtp is optional for several formats like the Opus Codec. Now, the format-attribute module is called with an empty fmtp, which allows the module to initialise itself to RFC defaults. Furthermore now, Asterisk is able to differentiate between internally and externally created formats. ASTERISK-25537 #close Change-Id: I28f680cef7fdf51c0969ff8da71548edad72ec52
Diffstat (limited to 'main/rtp_engine.c')
-rw-r--r--main/rtp_engine.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/main/rtp_engine.c b/main/rtp_engine.c
index 1460a7ac8..32909090f 100644
--- a/main/rtp_engine.c
+++ b/main/rtp_engine.c
@@ -973,9 +973,13 @@ int ast_rtp_codecs_payloads_set_rtpmap_type_rate(struct ast_rtp_codecs *codecs,
if (t->payload_type.asterisk_format
&& ast_format_cmp(t->payload_type.format, ast_format_g726) == AST_FORMAT_CMP_EQUAL
&& (options & AST_RTP_OPT_G726_NONSTANDARD)) {
- new_type->format = ao2_bump(ast_format_g726_aal2);
+ new_type->format = ast_format_g726_aal2;
} else {
- new_type->format = ao2_bump(t->payload_type.format);
+ new_type->format = t->payload_type.format;
+ }
+ if (new_type->format) {
+ /* SDP parsing automatically increases the reference count */
+ new_type->format = ast_format_parse_sdp_fmtp(new_type->format, "");
}
if (pt < AST_VECTOR_SIZE(&codecs->payload_mapping_tx)) {