Author: seanbright Date: Wed Jan 28 06:19:28 2015 New Revision: 431268 URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=431268 Log: media formats: update res_format_attr_opus & silk
In r419044, we changed how formats were handled, but the return value of the format_parse_sdp_fmtp functions in res_format_attr_opus and res_format_attr_silk were not updated, causing calls to fail. Ran into this when getting codec_opus working with Asterisk 13. Once the return value was corrected, we were crashing in opus_getjoint because of NULL format attributes. I've fixed this as well in this patch. ........ Merged revisions 431267 from http://svn.asterisk.org/svn/asterisk/branches/13 Modified: trunk/ (props changed) trunk/res/res_format_attr_opus.c trunk/res/res_format_attr_silk.c Propchange: trunk/ ------------------------------------------------------------------------------ Binary property 'branch-13-merged' - no diff available. Modified: trunk/res/res_format_attr_opus.c URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_format_attr_opus.c?view=diff&rev=431268&r1=431267&r2=431268 ============================================================================== --- trunk/res/res_format_attr_opus.c (original) +++ trunk/res/res_format_attr_opus.c Wed Jan 28 06:19:28 2015 @@ -51,6 +51,12 @@ unsigned int spropstereo; /* Default 0 */ }; +static struct opus_attr default_opus_attr = { + .fec = 0, + .dtx = 0, + .stereo = 0, +}; + static void opus_destroy(struct ast_format *format) { struct opus_attr *attr = ast_format_get_attribute_data(format); @@ -120,7 +126,7 @@ attr->dtx = val; } - return 0; + return cloned; } static void opus_generate_sdp_fmtp(const struct ast_format *format, unsigned int payload, struct ast_str **str) @@ -163,6 +169,14 @@ struct ast_format *jointformat; struct opus_attr *attr_res; + if (!attr1) { + attr1 = &default_opus_attr; + } + + if (!attr2) { + attr2 = &default_opus_attr; + } + jointformat = ast_format_clone(format1); if (!jointformat) { return NULL; Modified: trunk/res/res_format_attr_silk.c URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_format_attr_silk.c?view=diff&rev=431268&r1=431267&r2=431268 ============================================================================== --- trunk/res/res_format_attr_silk.c (original) +++ trunk/res/res_format_attr_silk.c Wed Jan 28 06:19:28 2015 @@ -94,7 +94,7 @@ attr->fec = val; } - return 0; + return cloned; } static void silk_generate_sdp_fmtp(const struct ast_format *format, unsigned int payload, struct ast_str **str) -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- svn-commits mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/svn-commits