Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b990e30a
提交
b990e30a
authored
9月 30, 2015
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-8240 finishing touches
上级
cc00d1d0
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
31 行增加
和
5 行删除
+31
-5
avformat.c
src/mod/applications/mod_av/avformat.c
+10
-2
mod_local_stream.c
src/mod/formats/mod_local_stream/mod_local_stream.c
+21
-3
没有找到文件。
src/mod/applications/mod_av/avformat.c
浏览文件 @
b990e30a
...
...
@@ -1809,10 +1809,14 @@ static switch_status_t av_file_read_video(switch_file_handle_t *handle, switch_f
int
fps
=
(
int
)
ceil
(
handle
->
mm
.
fps
);
int
min_qsize
=
context
->
read_fps
;
if
(
fps
<
min_qsize
)
{
if
(
fps
&&
fps
<
min_qsize
)
{
min_qsize
=
fps
;
}
if
(
!
min_qsize
)
{
min_qsize
=
1
;
}
if
(
!
context
->
file_read_thread_running
)
{
return
SWITCH_STATUS_FALSE
;
}
...
...
@@ -1821,6 +1825,10 @@ static switch_status_t av_file_read_video(switch_file_handle_t *handle, switch_f
return
SWITCH_STATUS_BREAK
;
}
if
(
switch_queue_size
(
context
->
eh
.
video_queue
)
<
min_qsize
/
2
)
{
return
SWITCH_STATUS_BREAK
;
}
while
((
flags
&
SVR_FLUSH
)
&&
switch_queue_size
(
context
->
eh
.
video_queue
)
>
min_qsize
)
{
if
(
switch_queue_trypop
(
context
->
eh
.
video_queue
,
&
pop
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_image_t
*
img
=
(
switch_image_t
*
)
pop
;
...
...
@@ -1831,7 +1839,7 @@ static switch_status_t av_file_read_video(switch_file_handle_t *handle, switch_f
if
(
!
context
->
file_read_thread_running
)
{
return
SWITCH_STATUS_FALSE
;
}
if
((
flags
&
SVR_BLOCK
))
{
status
=
switch_queue_pop
(
context
->
eh
.
video_queue
,
&
pop
);
}
else
{
...
...
src/mod/formats/mod_local_stream/mod_local_stream.c
浏览文件 @
b990e30a
...
...
@@ -70,6 +70,7 @@ struct local_stream_context {
int
last_h
;
int
serno
;
int
pop_count
;
int
video_sync
;
switch_image_t
*
banner_img
;
switch_time_t
banner_timeout
;
struct
local_stream_context
*
next
;
...
...
@@ -160,6 +161,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
switch_memory_pool_t
*
temp_pool
=
NULL
;
uint32_t
dir_count
=
0
,
do_shuffle
=
0
;
char
*
p
;
int
old_total
=
0
;
switch_mutex_lock
(
globals
.
mutex
);
THREADS
++
;
...
...
@@ -362,6 +364,16 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
is_open
=
switch_test_flag
(
use_fh
,
SWITCH_FILE_OPEN
);
if
(
is_open
&&
source
->
total
!=
old_total
&&
source
->
total
==
1
)
{
if
(
switch_core_file_has_video
(
&
fh
))
{
flush_video_queue
(
source
->
video_q
);
}
switch_buffer_zero
(
audio_buffer
);
}
old_total
=
source
->
total
;
if
(
source
->
hup
)
{
source
->
hup
=
0
;
if
(
is_open
)
{
...
...
@@ -415,7 +427,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
switch_core_file_read
(
&
fh
,
abuf
,
&
olen
);
olen
=
source
->
samples
;
}
if
(
switch_core_file_read
(
use_fh
,
abuf
,
&
olen
)
!=
SWITCH_STATUS_SUCCESS
||
!
olen
)
{
switch_core_file_close
(
use_fh
);
flush_video_queue
(
source
->
video_q
);
...
...
@@ -453,6 +465,8 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
break
;
}
source
->
prebuf
=
source
->
samples
*
2
*
source
->
channels
*
10
;
if
(
!
is_open
||
used
>=
source
->
prebuf
||
(
source
->
total
&&
used
>
source
->
samples
*
2
*
source
->
channels
))
{
void
*
pop
;
...
...
@@ -760,7 +774,9 @@ static switch_status_t local_stream_file_read_video(switch_file_handle_t *handle
local_stream_context_t
*
context
=
handle
->
private_info
;
switch_status_t
status
;
switch_time_t
now
;
int
fps
=
(
int
)
ceil
(
handle
->
mm
.
fps
);
int
min_qsize
=
fps
;
if
(
!
(
context
->
ready
&&
context
->
source
->
ready
))
{
return
SWITCH_STATUS_FALSE
;
}
...
...
@@ -798,7 +814,9 @@ static switch_status_t local_stream_file_read_video(switch_file_handle_t *handle
return
SWITCH_STATUS_BREAK
;
}
while
(
context
->
ready
&&
context
->
source
->
ready
&&
(
flags
&
SVR_FLUSH
)
&&
switch_queue_size
(
context
->
video_q
)
>
1
)
{
context
->
video_sync
=
1
;
while
(
context
->
ready
&&
context
->
source
->
ready
&&
(
flags
&
SVR_FLUSH
)
&&
switch_queue_size
(
context
->
video_q
)
>
min_qsize
)
{
if
(
switch_queue_trypop
(
context
->
video_q
,
&
pop
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_image_t
*
img
=
(
switch_image_t
*
)
pop
;
switch_img_free
(
&
img
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论