diff options
author | Joshua Colp <jcolp@digium.com> | 2016-11-28 08:57:44 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2016-11-28 08:57:44 -0600 |
commit | c9cc64b911243dfce860ff7e9902a1265a54f889 (patch) | |
tree | 0bbcc7e032a1ae7e51b80371c860d974d2a89b21 /res/res_format_attr_opus.c | |
parent | e3dae763ee77485bcbcf8818d2b8c9570afe3013 (diff) | |
parent | b2b5f9d897d1534f366b1b96fb10ad1de4f9ba5d (diff) |
Merge "ast_format: Adds an identifier for interleaved audio formats to the ast_format"
Diffstat (limited to 'res/res_format_attr_opus.c')
-rw-r--r-- | res/res_format_attr_opus.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/res/res_format_attr_opus.c b/res/res_format_attr_opus.c index 81a07a1f6..45aa5e5c6 100644 --- a/res/res_format_attr_opus.c +++ b/res/res_format_attr_opus.c @@ -94,6 +94,7 @@ static int opus_clone(const struct ast_format *src, struct ast_format *dst) ao2_bump(attr->data); ast_format_set_attribute_data(dst, attr); + ast_format_set_channel_count(dst, ast_format_get_channel_count(src)); return 0; } @@ -145,6 +146,9 @@ static struct ast_format *opus_parse_sdp_fmtp(const struct ast_format *format, c sdp_fmtp_get(attributes, CODEC_OPUS_ATTR_PTIME, &attr->ptime); sdp_fmtp_get(attributes, CODEC_OPUS_ATTR_MAX_AVERAGE_BITRATE, &attr->maxbitrate); sdp_fmtp_get(attributes, CODEC_OPUS_ATTR_STEREO, &attr->stereo); + if (attr->stereo) { + ast_format_set_channel_count(cloned, 2); + } sdp_fmtp_get(attributes, CODEC_OPUS_ATTR_SPROP_STEREO, &attr->spropstereo); sdp_fmtp_get(attributes, CODEC_OPUS_ATTR_CBR, &attr->cbr); sdp_fmtp_get(attributes, CODEC_OPUS_ATTR_FEC, &attr->fec); @@ -238,6 +242,10 @@ static struct ast_format *opus_getjoint(const struct ast_format *format1, const if (!jointformat) { return NULL; } + + if (ast_format_get_channel_count(format1) == 2 || ast_format_get_channel_count(format2) == 2) { + ast_format_set_channel_count(jointformat, 2); + } attr_res = ast_format_get_attribute_data(jointformat); attr_res->dtx = attr1->dtx || attr2->dtx ? 1 : 0; |