Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
8ab31493
提交
8ab31493
authored
10月 24, 2013
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make exception for g722
上级
55c86bff
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
9 行增加
和
5 行删除
+9
-5
switch_core_codec.c
src/switch_core_codec.c
+4
-2
switch_loadable_module.c
src/switch_loadable_module.c
+5
-3
没有找到文件。
src/switch_core_codec.c
浏览文件 @
8ab31493
...
@@ -655,7 +655,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_init_with_bitrate(switch_codec
...
@@ -655,7 +655,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_init_with_bitrate(switch_codec
/* If no specific codec interval is requested opt for 20ms above all else because lots of stuff assumes it */
/* If no specific codec interval is requested opt for 20ms above all else because lots of stuff assumes it */
if
(
!
ms
)
{
if
(
!
ms
)
{
for
(
iptr
=
codec_interface
->
implementations
;
iptr
;
iptr
=
iptr
->
next
)
{
for
(
iptr
=
codec_interface
->
implementations
;
iptr
;
iptr
=
iptr
->
next
)
{
if
((
!
rate
||
rate
==
iptr
->
samples_per_second
)
&&
(
!
bitrate
||
bitrate
==
(
uint32_t
)
iptr
->
bits_per_second
)
&&
uint32_t
crate
=
!
strcasecmp
(
codec_name
,
"g722"
)
?
iptr
->
samples_per_second
:
iptr
->
actual_samples_per_second
;
if
((
!
rate
||
rate
==
crate
)
&&
(
!
bitrate
||
bitrate
==
(
uint32_t
)
iptr
->
bits_per_second
)
&&
(
20
==
(
iptr
->
microseconds_per_packet
/
1000
))
&&
(
!
channels
||
channels
==
iptr
->
number_of_channels
))
{
(
20
==
(
iptr
->
microseconds_per_packet
/
1000
))
&&
(
!
channels
||
channels
==
iptr
->
number_of_channels
))
{
implementation
=
iptr
;
implementation
=
iptr
;
goto
found
;
goto
found
;
...
@@ -665,7 +666,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_init_with_bitrate(switch_codec
...
@@ -665,7 +666,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_init_with_bitrate(switch_codec
/* Either looking for a specific interval or there was no interval specified and there wasn't one @20ms available */
/* Either looking for a specific interval or there was no interval specified and there wasn't one @20ms available */
for
(
iptr
=
codec_interface
->
implementations
;
iptr
;
iptr
=
iptr
->
next
)
{
for
(
iptr
=
codec_interface
->
implementations
;
iptr
;
iptr
=
iptr
->
next
)
{
if
((
!
rate
||
rate
==
iptr
->
samples_per_second
)
&&
(
!
bitrate
||
bitrate
==
(
uint32_t
)
iptr
->
bits_per_second
)
&&
uint32_t
crate
=
!
strcasecmp
(
codec_name
,
"g722"
)
?
iptr
->
samples_per_second
:
iptr
->
actual_samples_per_second
;
if
((
!
rate
||
rate
==
crate
)
&&
(
!
bitrate
||
bitrate
==
(
uint32_t
)
iptr
->
bits_per_second
)
&&
(
!
ms
||
ms
==
(
iptr
->
microseconds_per_packet
/
1000
))
&&
(
!
channels
||
channels
==
iptr
->
number_of_channels
))
{
(
!
ms
||
ms
==
(
iptr
->
microseconds_per_packet
/
1000
))
&&
(
!
channels
||
channels
==
iptr
->
number_of_channels
))
{
implementation
=
iptr
;
implementation
=
iptr
;
break
;
break
;
...
...
src/switch_loadable_module.c
浏览文件 @
8ab31493
...
@@ -2310,13 +2310,14 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_
...
@@ -2310,13 +2310,14 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_
uint32_t
default_rate
=
switch_default_rate
(
imp
->
iananame
,
imp
->
ianacode
);
uint32_t
default_rate
=
switch_default_rate
(
imp
->
iananame
,
imp
->
ianacode
);
if
(
imp
->
codec_type
!=
SWITCH_CODEC_TYPE_VIDEO
)
{
if
(
imp
->
codec_type
!=
SWITCH_CODEC_TYPE_VIDEO
)
{
uint32_t
crate
=
!
strcasecmp
(
imp
->
iananame
,
"g722"
)
?
imp
->
samples_per_second
:
imp
->
actual_samples_per_second
;
if
((
!
interval
&&
(
uint32_t
)
(
imp
->
microseconds_per_packet
/
1000
)
!=
default_ptime
)
||
if
((
!
interval
&&
(
uint32_t
)
(
imp
->
microseconds_per_packet
/
1000
)
!=
default_ptime
)
||
(
interval
&&
(
uint32_t
)
(
imp
->
microseconds_per_packet
/
1000
)
!=
interval
))
{
(
interval
&&
(
uint32_t
)
(
imp
->
microseconds_per_packet
/
1000
)
!=
interval
))
{
continue
;
continue
;
}
}
if
(((
!
rate
&&
(
uint32_t
)
imp
->
actual_samples_per_second
!=
default_rate
)
||
(
rate
&&
(
uint32_t
)
imp
->
actual_samples_per_second
!=
rate
)))
{
if
(((
!
rate
&&
crate
!=
default_rate
)
||
(
rate
&&
(
uint32_t
)
imp
->
actual_samples_per_second
!=
rate
)))
{
continue
;
continue
;
}
}
...
@@ -2335,12 +2336,13 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_
...
@@ -2335,12 +2336,13 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_
/* Either looking for a specific interval or there was no interval specified and there wasn't one at the default ptime available */
/* Either looking for a specific interval or there was no interval specified and there wasn't one at the default ptime available */
for
(
imp
=
codec_interface
->
implementations
;
imp
;
imp
=
imp
->
next
)
{
for
(
imp
=
codec_interface
->
implementations
;
imp
;
imp
=
imp
->
next
)
{
if
(
imp
->
codec_type
!=
SWITCH_CODEC_TYPE_VIDEO
)
{
if
(
imp
->
codec_type
!=
SWITCH_CODEC_TYPE_VIDEO
)
{
uint32_t
crate
=
!
strcasecmp
(
imp
->
iananame
,
"g722"
)
?
imp
->
samples_per_second
:
imp
->
actual_samples_per_second
;
if
(
interval
&&
(
uint32_t
)
(
imp
->
microseconds_per_packet
/
1000
)
!=
interval
)
{
if
(
interval
&&
(
uint32_t
)
(
imp
->
microseconds_per_packet
/
1000
)
!=
interval
)
{
continue
;
continue
;
}
}
if
(
rate
&&
(
uint32_t
)
imp
->
actual_samples_per_second
!=
rate
)
{
if
(
rate
&&
(
uint32_t
)
crate
!=
rate
)
{
continue
;
continue
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论