Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
2c66f126
提交
2c66f126
authored
11月 28, 2017
作者:
Anthony Minessale
提交者:
Muteesa Fred
7月 24, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-10769: [mod_av,mod_conference] Lipsync issues in conference recording
上级
6bd169ab
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
35 行增加
和
14 行删除
+35
-14
avformat.c
src/mod/applications/mod_av/avformat.c
+31
-13
conference_video.c
src/mod/applications/mod_conference/conference_video.c
+4
-1
没有找到文件。
src/mod/applications/mod_av/avformat.c
浏览文件 @
2c66f126
...
@@ -130,6 +130,8 @@ struct av_file_context {
...
@@ -130,6 +130,8 @@ struct av_file_context {
switch_file_handle_t
*
handle
;
switch_file_handle_t
*
handle
;
int16_t
*
mux_buf
;
int16_t
*
mux_buf
;
switch_size_t
mux_buf_len
;
switch_size_t
mux_buf_len
;
switch_time_t
last_vid_write
;
};
};
typedef
struct
av_file_context
av_file_context_t
;
typedef
struct
av_file_context
av_file_context_t
;
...
@@ -1845,8 +1847,8 @@ static switch_status_t av_file_write(switch_file_handle_t *handle, void *data, s
...
@@ -1845,8 +1847,8 @@ static switch_status_t av_file_write(switch_file_handle_t *handle, void *data, s
// uint32_t size = 0;
// uint32_t size = 0;
uint32_t
bytes
;
uint32_t
bytes
;
int
inuse
;
int
inuse
;
int
sample_start
;
int
sample_start
=
0
;
if
(
!
switch_test_flag
(
handle
,
SWITCH_FILE_FLAG_WRITE
))
{
if
(
!
switch_test_flag
(
handle
,
SWITCH_FILE_FLAG_WRITE
))
{
return
SWITCH_STATUS_FALSE
;
return
SWITCH_STATUS_FALSE
;
}
}
...
@@ -1901,12 +1903,38 @@ GCC_DIAG_ON(deprecated-declarations)
...
@@ -1901,12 +1903,38 @@ GCC_DIAG_ON(deprecated-declarations)
}
}
}
}
if
(
context
->
video_timer
.
interval
)
{
int
delta
;
switch_core_timer_sync
(
&
context
->
video_timer
);
delta
=
context
->
video_timer
.
samplecount
-
context
->
last_vid_write
;
if
(
delta
>=
60
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"Video timer sync: %ld/%d %ld
\n
"
,
context
->
audio_st
[
0
].
next_pts
,
context
->
video_timer
.
samplecount
,
context
->
audio_st
[
0
].
next_pts
-
context
->
video_timer
.
samplecount
);
sample_start
=
context
->
video_timer
.
samplecount
*
(
handle
->
samplerate
/
1000
);
}
context
->
last_vid_write
=
context
->
video_timer
.
samplecount
;
}
if
(
sample_start
)
{
int
j
=
0
;
for
(
j
=
0
;
j
<
2
;
j
++
)
{
if
(
context
->
audio_st
[
j
].
active
)
{
context
->
audio_st
[
j
].
next_pts
=
sample_start
;
}
}
}
while
((
inuse
=
switch_buffer_inuse
(
context
->
audio_buffer
))
>=
bytes
)
{
while
((
inuse
=
switch_buffer_inuse
(
context
->
audio_buffer
))
>=
bytes
)
{
AVPacket
pkt
[
2
]
=
{
{
0
}
};
AVPacket
pkt
[
2
]
=
{
{
0
}
};
int
got_packet
[
2
]
=
{
0
};
int
got_packet
[
2
]
=
{
0
};
int
j
=
0
,
ret
=
-
1
,
audio_stream_count
=
1
;
int
j
=
0
,
ret
=
-
1
,
audio_stream_count
=
1
;
AVFrame
*
use_frame
=
NULL
;
AVFrame
*
use_frame
=
NULL
;
av_init_packet
(
&
pkt
[
0
]);
av_init_packet
(
&
pkt
[
0
]);
av_init_packet
(
&
pkt
[
1
]);
av_init_packet
(
&
pkt
[
1
]);
...
@@ -1936,16 +1964,6 @@ GCC_DIAG_ON(deprecated-declarations)
...
@@ -1936,16 +1964,6 @@ GCC_DIAG_ON(deprecated-declarations)
switch_buffer_read
(
context
->
audio_buffer
,
context
->
audio_st
[
0
].
frame
->
data
[
0
],
bytes
);
switch_buffer_read
(
context
->
audio_buffer
,
context
->
audio_st
[
0
].
frame
->
data
[
0
],
bytes
);
}
}
/* Sync all audio stream timestamps to video timer */
if
(
context
->
video_timer
.
interval
)
{
switch_core_timer_sync
(
&
context
->
video_timer
);
sample_start
=
context
->
video_timer
.
samplecount
*
(
handle
->
samplerate
/
1000
);
for
(
j
=
0
;
j
<
audio_stream_count
;
j
++
)
{
context
->
audio_st
[
j
].
next_pts
=
sample_start
;
}
}
for
(
j
=
0
;
j
<
audio_stream_count
;
j
++
)
{
for
(
j
=
0
;
j
<
audio_stream_count
;
j
++
)
{
av_frame_make_writable
(
context
->
audio_st
[
j
].
frame
);
av_frame_make_writable
(
context
->
audio_st
[
j
].
frame
);
...
...
src/mod/applications/mod_conference/conference_video.c
浏览文件 @
2c66f126
...
@@ -3071,7 +3071,9 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
...
@@ -3071,7 +3071,9 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
canvas
->
video_count
=
last_video_count
=
video_count
;
canvas
->
video_count
=
last_video_count
=
video_count
;
switch_mutex_unlock
(
conference
->
member_mutex
);
switch_mutex_unlock
(
conference
->
member_mutex
);
switch_core_timer_next
(
&
canvas
->
timer
);
if
(
canvas
->
playing_video_file
)
{
switch_core_timer_next
(
&
canvas
->
timer
);
}
now
=
switch_micro_time_now
();
now
=
switch_micro_time_now
();
...
@@ -3841,6 +3843,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
...
@@ -3841,6 +3843,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
}
}
}
}
switch_core_timer_next
(
&
canvas
->
timer
);
wait_for_canvas
(
canvas
);
wait_for_canvas
(
canvas
);
for
(
i
=
0
;
i
<
canvas
->
total_layers
;
i
++
)
{
for
(
i
=
0
;
i
<
canvas
->
total_layers
;
i
++
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论