Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
65135c5f
提交
65135c5f
authored
7月 13, 2015
作者:
Dragos Oancea
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7832: fixes when comparing local and remote fmtp params
上级
d18c964b
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
6 行删除
+10
-6
mod_opus.c
src/mod/codecs/mod_opus/mod_opus.c
+10
-6
没有找到文件。
src/mod/codecs/mod_opus/mod_opus.c
浏览文件 @
65135c5f
...
...
@@ -312,7 +312,7 @@ static switch_status_t switch_opus_init(switch_codec_t *codec, switch_codec_flag
struct
opus_context
*
context
=
NULL
;
int
encoding
=
(
flags
&
SWITCH_CODEC_FLAG_ENCODE
);
int
decoding
=
(
flags
&
SWITCH_CODEC_FLAG_DECODE
);
switch_codec_fmtp_t
codec_fmtp
;
switch_codec_fmtp_t
codec_fmtp
,
codec_fmtp_only_remote
;
opus_codec_settings_t
opus_codec_settings
=
{
0
};
opus_codec_settings_t
opus_codec_settings_remote
=
{
0
};
...
...
@@ -326,6 +326,11 @@ static switch_status_t switch_opus_init(switch_codec_t *codec, switch_codec_flag
memset
(
&
codec_fmtp
,
'\0'
,
sizeof
(
struct
switch_codec_fmtp
));
codec_fmtp
.
private_info
=
&
opus_codec_settings
;
switch_opus_fmtp_parse
(
codec
->
fmtp_in
,
&
codec_fmtp
);
if
(
opus_prefs
.
asymmetric_samplerates
)
{
/* save the remote fmtp values, before processing */
codec_fmtp_only_remote
.
private_info
=
&
opus_codec_settings_remote
;
switch_opus_fmtp_parse
(
codec
->
fmtp_in
,
&
codec_fmtp_only_remote
);
}
context
->
codec_settings
=
opus_codec_settings
;
/* Verify if the local or remote configuration are lowering maxaveragebitrate and/or maxplaybackrate */
...
...
@@ -363,7 +368,7 @@ static switch_status_t switch_opus_init(switch_codec_t *codec, switch_codec_flag
* maxplaybackrate=R3,sprop-maxcapturerate=R4
* then it should start the encoder at sample rate: min(R1, R4) and the decoder at sample rate: min(R3, R2)*/
if
(
codec_fmtp
.
private_info
)
{
opus_codec_settings_t
*
codec_settings
=
codec_fmtp
.
private_info
;
opus_codec_settings_t
*
codec_settings
=
codec_fmtp
_only_remote
.
private_info
;
if
(
opus_codec_settings
.
sprop_maxcapturerate
||
codec_settings
->
maxplaybackrate
)
{
enc_samplerate
=
opus_codec_settings
.
sprop_maxcapturerate
;
/*R4*/
if
(
codec_settings
->
maxplaybackrate
<
enc_samplerate
&&
codec_settings
->
maxplaybackrate
)
{
...
...
@@ -449,7 +454,7 @@ static switch_status_t switch_opus_init(switch_codec_t *codec, switch_codec_flag
if
(
opus_prefs
.
asymmetric_samplerates
)
{
if
(
codec_fmtp
.
private_info
)
{
opus_codec_settings_t
*
codec_settings
=
codec_fmtp
.
private_info
;
opus_codec_settings_t
*
codec_settings
=
codec_fmtp
_only_remote
.
private_info
;
if
(
opus_codec_settings
.
maxplaybackrate
||
codec_settings
->
sprop_maxcapturerate
)
{
dec_samplerate
=
opus_codec_settings
.
maxplaybackrate
;
/* R3 */
if
(
dec_samplerate
>
codec_settings
->
sprop_maxcapturerate
&&
codec_settings
->
sprop_maxcapturerate
){
...
...
@@ -619,14 +624,13 @@ static switch_status_t opus_load_config(switch_bool_t reload)
}
}
else
if
(
!
strcasecmp
(
key
,
"maxplaybackrate"
))
{
opus_prefs
.
maxplaybackrate
=
atoi
(
val
);
if
(
opus_prefs
.
maxplaybackrate
!=
8000
&&
opus_prefs
.
maxplaybackrate
!=
12000
&&
opus_prefs
.
maxplaybackrate
!=
16000
&&
opus_prefs
.
maxplaybackrate
!=
24000
&&
opus_prefs
.
maxplaybackrate
!=
48000
)
{
if
(
!
switch_opus_acceptable_rate
(
opus_prefs
.
maxplaybackrate
))
{
opus_prefs
.
maxplaybackrate
=
0
;
/* value not supported */
}
}
else
if
(
!
strcasecmp
(
key
,
"sprop-maxcapturerate"
))
{
opus_prefs
.
sprop_maxcapturerate
=
atoi
(
val
);
if
(
!
switch_opus_acceptable_rate
(
opus_prefs
.
sprop_maxcapturerate
))
{
opus_prefs
.
maxplayback
rate
=
0
;
/* value not supported */
opus_prefs
.
sprop_maxcapture
rate
=
0
;
/* value not supported */
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论