Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
3c83138b
提交
3c83138b
authored
9月 20, 2013
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-5807 contd
上级
75da9d1e
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
48 行增加
和
11 行删除
+48
-11
switch_module_interfaces.h
src/include/switch_module_interfaces.h
+3
-1
switch_types.h
src/include/switch_types.h
+2
-1
mod_dptools.c
src/mod/applications/mod_dptools/mod_dptools.c
+10
-4
switch_core_file.c
src/switch_core_file.c
+11
-2
switch_ivr_play_say.c
src/switch_ivr_play_say.c
+22
-3
没有找到文件。
src/include/switch_module_interfaces.h
浏览文件 @
3c83138b
...
...
@@ -310,7 +310,7 @@ struct switch_file_handle {
/*! the current native samplerate */
uint32_t
native_rate
;
/*! the number of channels */
uint
8
_t
channels
;
uint
32
_t
channels
;
/*! integer representation of the format */
unsigned
int
format
;
/*! integer representation of the sections */
...
...
@@ -353,6 +353,8 @@ struct switch_file_handle {
const
char
*
prefix
;
int
max_samples
;
switch_event_t
*
params
;
uint32_t
cur_channels
;
uint32_t
cur_samplerate
;
};
/*! \brief Abstract interface to an asr module */
...
...
src/include/switch_types.h
浏览文件 @
3c83138b
...
...
@@ -1615,7 +1615,8 @@ typedef enum {
SWITCH_FILE_BUFFER_DONE
=
(
1
<<
14
),
SWITCH_FILE_WRITE_APPEND
=
(
1
<<
15
),
SWITCH_FILE_WRITE_OVER
=
(
1
<<
16
),
SWITCH_FILE_NOMUX
=
(
1
<<
17
)
SWITCH_FILE_NOMUX
=
(
1
<<
17
),
SWITCH_FILE_BREAK_ON_CHANGE
=
(
1
<<
18
)
}
switch_file_flag_enum_t
;
typedef
uint32_t
switch_file_flag_t
;
...
...
src/mod/applications/mod_dptools/mod_dptools.c
浏览文件 @
3c83138b
...
...
@@ -4509,8 +4509,8 @@ static switch_status_t next_file(switch_file_handle_t *handle)
}
handle
->
samples
=
context
->
fh
.
samples
;
//handle->
samplerate = context->fh.samplerate;
//handle->
channels = context->fh.channels;
handle
->
cur_
samplerate
=
context
->
fh
.
samplerate
;
handle
->
cur_
channels
=
context
->
fh
.
channels
;
handle
->
format
=
context
->
fh
.
format
;
handle
->
sections
=
context
->
fh
.
sections
;
handle
->
seekable
=
context
->
fh
.
seekable
;
...
...
@@ -4518,6 +4518,7 @@ static switch_status_t next_file(switch_file_handle_t *handle)
handle
->
interval
=
context
->
fh
.
interval
;
handle
->
max_samples
=
0
;
if
(
switch_test_flag
((
&
context
->
fh
),
SWITCH_FILE_NATIVE
))
{
switch_set_flag
(
handle
,
SWITCH_FILE_NATIVE
);
}
else
{
...
...
@@ -4602,8 +4603,13 @@ static switch_status_t file_string_file_read(switch_file_handle_t *handle, void
if
((
status
=
next_file
(
handle
))
!=
SWITCH_STATUS_SUCCESS
)
{
return
status
;
}
*
len
=
llen
;
status
=
switch_core_file_read
(
&
context
->
fh
,
data
,
len
);
if
(
switch_test_flag
(
handle
,
SWITCH_FILE_BREAK_ON_CHANGE
))
{
*
len
=
0
;
status
=
SWITCH_STATUS_BREAK
;
}
else
{
*
len
=
llen
;
status
=
switch_core_file_read
(
&
context
->
fh
,
data
,
len
);
}
}
return
status
;
...
...
src/switch_core_file.c
浏览文件 @
3c83138b
...
...
@@ -292,7 +292,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_read(switch_file_handle_t *fh,
rlen
=
asis
?
fh
->
pre_buffer_datalen
:
fh
->
pre_buffer_datalen
/
2
;
if
(
switch_buffer_inuse
(
fh
->
pre_buffer
)
<
rlen
*
2
)
{
if
((
status
=
fh
->
file_interface
->
file_read
(
fh
,
fh
->
pre_buffer_data
,
&
rlen
))
!=
SWITCH_STATUS_SUCCESS
||
!
rlen
)
{
if
((
status
=
fh
->
file_interface
->
file_read
(
fh
,
fh
->
pre_buffer_data
,
&
rlen
))
==
SWITCH_STATUS_BREAK
)
{
return
SWITCH_STATUS_BREAK
;
}
if
(
status
!=
SWITCH_STATUS_SUCCESS
||
!
rlen
)
{
switch_set_flag
(
fh
,
SWITCH_FILE_BUFFER_DONE
);
}
else
{
fh
->
samples_in
+=
rlen
;
...
...
@@ -316,7 +321,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_read(switch_file_handle_t *fh,
}
else
{
if
((
status
=
fh
->
file_interface
->
file_read
(
fh
,
data
,
len
))
!=
SWITCH_STATUS_SUCCESS
||
!*
len
)
{
if
((
status
=
fh
->
file_interface
->
file_read
(
fh
,
data
,
len
))
==
SWITCH_STATUS_BREAK
)
{
return
SWITCH_STATUS_BREAK
;
}
if
(
status
!=
SWITCH_STATUS_SUCCESS
||
!*
len
)
{
switch_set_flag
(
fh
,
SWITCH_FILE_DONE
);
goto
top
;
}
...
...
src/switch_ivr_play_say.c
浏览文件 @
3c83138b
...
...
@@ -1049,6 +1049,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
int
more_data
=
0
;
switch_event_t
*
event
;
uint32_t
test_native
=
0
,
last_native
=
0
;
uint32_t
buflen
=
0
;
if
(
switch_channel_pre_answer
(
channel
)
!=
SWITCH_STATUS_SUCCESS
)
{
return
SWITCH_STATUS_FALSE
;
...
...
@@ -1110,6 +1111,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
fh
->
samples
=
0
;
}
for
(
cur
=
0
;
switch_channel_ready
(
channel
)
&&
!
done
&&
cur
<
argc
;
cur
++
)
{
file
=
argv
[
cur
];
eof
=
0
;
...
...
@@ -1255,9 +1259,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
if
(
!
abuf
)
{
switch_zmalloc
(
abuf
,
FILE_STARTSAMPLES
*
sizeof
(
*
abuf
)
*
fh
->
channels
);
buflen
=
write_frame
.
buflen
=
FILE_STARTSAMPLES
*
sizeof
(
*
abuf
)
*
fh
->
channels
;
switch_zmalloc
(
abuf
,
write_frame
.
buflen
);
write_frame
.
data
=
abuf
;
write_frame
.
buflen
=
FILE_STARTSAMPLES
;
}
if
(
sample_start
>
0
)
{
...
...
@@ -1454,6 +1458,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
}
}
buflen
=
FILE_STARTSAMPLES
*
sizeof
(
*
abuf
)
*
fh
->
cur_channels
;
if
(
buflen
>
write_frame
.
buflen
)
{
abuf
=
realloc
(
abuf
,
buflen
);
write_frame
.
data
=
abuf
;
write_frame
.
buflen
=
buflen
;
}
if
(
switch_test_flag
(
fh
,
SWITCH_FILE_PAUSE
))
{
if
(
framelen
>
FILE_STARTSAMPLES
)
{
framelen
=
FILE_STARTSAMPLES
;
...
...
@@ -1493,6 +1505,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
olen
=
switch_test_flag
(
fh
,
SWITCH_FILE_NATIVE
)
?
framelen
:
ilen
;
}
else
{
switch_status_t
rstatus
;
if
(
eof
)
{
break
;
}
...
...
@@ -1500,7 +1514,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
if
(
!
switch_test_flag
(
fh
,
SWITCH_FILE_NATIVE
))
{
olen
/=
2
;
}
if
(
switch_core_file_read
(
fh
,
abuf
,
&
olen
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_set_flag
(
fh
,
SWITCH_FILE_BREAK_ON_CHANGE
);
if
((
rstatus
=
switch_core_file_read
(
fh
,
abuf
,
&
olen
))
==
SWITCH_STATUS_BREAK
)
{
continue
;
}
if
(
rstatus
!=
SWITCH_STATUS_SUCCESS
)
{
eof
++
;
continue
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论