提交 ccc013e0 authored 作者: Anthony Minessale's avatar Anthony Minessale

opus drama stable edition

上级 98634890
...@@ -39,13 +39,13 @@ ...@@ -39,13 +39,13 @@
switch_cache_db_handle_t *_sofia_glue_get_db_handle(sofia_profile_t *profile, const char *file, const char *func, int line); switch_cache_db_handle_t *_sofia_glue_get_db_handle(sofia_profile_t *profile, const char *file, const char *func, int line);
#define sofia_glue_get_db_handle(_p) _sofia_glue_get_db_handle(_p, __FILE__, __SWITCH_FUNC__, __LINE__) #define sofia_glue_get_db_handle(_p) _sofia_glue_get_db_handle(_p, __FILE__, __SWITCH_FUNC__, __LINE__)
static int get_channels(const switch_codec_implementation_t *imp) static int get_channels(const char *name, int dft)
{ {
if (!strcasecmp(imp->iananame, "opus")) { if (!strcasecmp(name, "opus")) {
return 2; /* IKR???*/ return 2; /* IKR???*/
} }
return imp->number_of_channels; return dft ? dft : 1;
} }
void sofia_glue_set_udptl_image_sdp(private_object_t *tech_pvt, switch_t38_options_t *t38_options, int insist) void sofia_glue_set_udptl_image_sdp(private_object_t *tech_pvt, switch_t38_options_t *t38_options, int insist)
...@@ -317,7 +317,7 @@ static void generate_m(private_object_t *tech_pvt, char *buf, size_t buflen, ...@@ -317,7 +317,7 @@ static void generate_m(private_object_t *tech_pvt, char *buf, size_t buflen,
} }
if (tech_pvt->ianacodes[i] > 95 || verbose_sdp) { if (tech_pvt->ianacodes[i] > 95 || verbose_sdp) {
int channels = get_channels(imp); int channels = get_channels(imp->iananame, imp->number_of_channels);
if (channels > 1) { if (channels > 1) {
switch_snprintf(buf + strlen(buf), buflen - strlen(buf), "a=rtpmap:%d %s/%d/%d\n", tech_pvt->ianacodes[i], imp->iananame, rate, channels); switch_snprintf(buf + strlen(buf), buflen - strlen(buf), "a=rtpmap:%d %s/%d/%d\n", tech_pvt->ianacodes[i], imp->iananame, rate, channels);
...@@ -547,6 +547,10 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch ...@@ -547,6 +547,10 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch
rate = tech_pvt->adv_rm_rate; rate = tech_pvt->adv_rm_rate;
if (!tech_pvt->adv_channels) {
tech_pvt->adv_channels = get_channels(tech_pvt->rm_encoding, 1);
}
if (tech_pvt->adv_channels > 1) { if (tech_pvt->adv_channels > 1) {
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=rtpmap:%d %s/%d/%d\n", switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=rtpmap:%d %s/%d/%d\n",
tech_pvt->agreed_pt, tech_pvt->rm_encoding, rate, tech_pvt->adv_channels); tech_pvt->agreed_pt, tech_pvt->rm_encoding, rate, tech_pvt->adv_channels);
...@@ -776,7 +780,7 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch ...@@ -776,7 +780,7 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch
rate = imp->samples_per_second; rate = imp->samples_per_second;
} }
channels = get_channels(imp); channels = get_channels(imp->iananame, imp->number_of_channels);
if (channels > 1) { if (channels > 1) {
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=rtpmap:%d %s/%d/%d\n", ianacode, imp->iananame, switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=rtpmap:%d %s/%d/%d\n", ianacode, imp->iananame,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论