Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
719850e5
提交
719850e5
authored
2月 28, 2014
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-5895 --resolve
上级
2c1a25d5
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
12 行增加
和
9 行删除
+12
-9
switch_types.h
src/include/switch_types.h
+1
-0
switch_rtp.c
src/switch_rtp.c
+11
-9
没有找到文件。
src/include/switch_types.h
浏览文件 @
719850e5
...
...
@@ -706,6 +706,7 @@ typedef enum {
SWITCH_RTP_FLAG_PAUSE
,
SWITCH_RTP_FLAG_FIR
,
SWITCH_RTP_FLAG_PLI
,
SWITCH_RTP_FLAG_RESET
,
SWITCH_RTP_FLAG_INVALID
}
switch_rtp_flag_t
;
...
...
src/switch_rtp.c
浏览文件 @
719850e5
...
...
@@ -67,7 +67,6 @@
#define MASTER_KEY_LEN 30
#define RTP_MAGIC_NUMBER 42
#define MAX_SRTP_ERRS 10
#define RTP_TS_RESET 1
#define DTMF_SANITY (rtp_session->one_second * 30)
...
...
@@ -4273,7 +4272,8 @@ static void do_2833(switch_rtp_t *rtp_session)
rtp_session
->
dtmf_data
.
timestamp_dtmf
=
rtp_session
->
last_write_ts
+
samples
;
rtp_session
->
last_write_ts
=
rtp_session
->
dtmf_data
.
timestamp_dtmf
;
rtp_session
->
flags
[
SWITCH_RTP_FLAG_RESET
]
=
0
;
wrote
=
switch_rtp_write_manual
(
rtp_session
,
rtp_session
->
dtmf_data
.
out_digit_packet
,
4
,
...
...
@@ -4306,7 +4306,7 @@ SWITCH_DECLARE(void) rtp_flush_read_buffer(switch_rtp_t *rtp_session, switch_rtp
if
(
switch_rtp_ready
(
rtp_session
))
{
rtp_session
->
last_write_ts
=
RTP_TS_RESET
;
rtp_session
->
flags
[
SWITCH_RTP_FLAG_RESET
]
=
1
;
rtp_session
->
flags
[
SWITCH_RTP_FLAG_FLUSH
]
=
1
;
reset_jitter_seq
(
rtp_session
);
...
...
@@ -6048,7 +6048,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
if
((
rtp_session
->
rtp_bugs
&
RTP_BUG_NEVER_SEND_MARKER
))
{
m
=
0
;
}
else
{
if
((
rtp_session
->
last_write_ts
!=
RTP_TS_RESET
&&
rtp_session
->
ts
>
(
rtp_session
->
last_write_ts
+
(
rtp_session
->
samples_per_interval
*
10
)))
if
((
!
rtp_session
->
flags
[
SWITCH_RTP_FLAG_RESET
]
&&
rtp_session
->
ts
>
(
rtp_session
->
last_write_ts
+
(
rtp_session
->
samples_per_interval
*
10
)))
||
rtp_session
->
ts
==
rtp_session
->
samples_per_interval
)
{
m
++
;
}
...
...
@@ -6075,13 +6075,13 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
}
if
(
m
)
{
rtp_session
->
last_write_ts
=
RTP_TS_RESET
;
rtp_session
->
flags
[
SWITCH_RTP_FLAG_RESET
]
=
1
;
rtp_session
->
ts
=
0
;
}
/* If the marker was set, and the timestamp seems to have started over - set a new SSRC, to indicate this is a new stream */
if
(
m
&&
!
switch_rtp_test_flag
(
rtp_session
,
SWITCH_RTP_FLAG_SECURE_SEND
)
&&
(
rtp_session
->
rtp_bugs
&
RTP_BUG_CHANGE_SSRC_ON_MARKER
)
&&
(
rtp_session
->
last_write_ts
==
RTP_TS_RESET
||
(
rtp_session
->
ts
<=
rtp_session
->
last_write_ts
&&
rtp_session
->
last_write_ts
>
0
)))
{
(
rtp_session
->
flags
[
SWITCH_RTP_FLAG_RESET
]
||
(
rtp_session
->
ts
<=
rtp_session
->
last_write_ts
&&
rtp_session
->
last_write_ts
>
0
)))
{
switch_rtp_set_ssrc
(
rtp_session
,
(
uint32_t
)
((
intptr_t
)
rtp_session
+
(
uint32_t
)
switch_epoch_time_now
(
NULL
)));
}
...
...
@@ -6269,11 +6269,11 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
this_ts
=
ntohl
(
send_msg
->
header
.
ts
);
if
(
abs
(
rtp_session
->
last_write_ts
-
this_ts
)
>
16000
)
{
rtp_session
->
last_write_ts
=
RTP_TS_RESET
;
rtp_session
->
flags
[
SWITCH_RTP_FLAG_RESET
]
=
1
;
}
if
(
!
switch_rtp_ready
(
rtp_session
)
||
rtp_session
->
sending_dtmf
||
!
this_ts
||
(
rtp_session
->
last_write_ts
>
RTP_TS_RESET
&&
this_ts
<
rtp_session
->
last_write_ts
))
{
(
!
rtp_session
->
flags
[
SWITCH_RTP_FLAG_RESET
]
&&
this_ts
<
rtp_session
->
last_write_ts
))
{
send
=
0
;
}
}
...
...
@@ -6386,6 +6386,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
}
rtp_session
->
last_write_ts
=
this_ts
;
rtp_session
->
flags
[
SWITCH_RTP_FLAG_RESET
]
=
0
;
if
(
rtp_session
->
queue_delay
)
{
rtp_session
->
delay_samples
=
rtp_session
->
queue_delay
;
...
...
@@ -6597,7 +6598,7 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_WARNING
,
"Generating RTP locally but timestamp passthru is configured, disabling....
\n
"
);
rtp_session
->
flags
[
SWITCH_RTP_FLAG_RAW_WRITE
]
=
0
;
rtp_session
->
last_write_ts
=
RTP_TS_RESET
;
rtp_session
->
flags
[
SWITCH_RTP_FLAG_RESET
]
=
1
;
}
switch_assert
(
frame
!=
NULL
);
...
...
@@ -6782,6 +6783,7 @@ SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp_t *rtp_session,
if
(((
*
flags
)
&
SFF_RTP_HEADER
))
{
rtp_session
->
last_write_ts
=
ts
;
rtp_session
->
flags
[
SWITCH_RTP_FLAG_RESET
]
=
0
;
}
ret
=
(
int
)
bytes
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论