Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
35d44c3f
提交
35d44c3f
authored
4月 20, 2017
作者:
Chris Rienzo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-10251 [mod_rayo] fix defects found by clang-analyzer
上级
a3e73259
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
9 行增加
和
3 行删除
+9
-3
rayo_input_component.c
src/mod/event_handlers/mod_rayo/rayo_input_component.c
+3
-0
rayo_output_component.c
src/mod/event_handlers/mod_rayo/rayo_output_component.c
+6
-3
没有找到文件。
src/mod/event_handlers/mod_rayo/rayo_input_component.c
浏览文件 @
35d44c3f
...
@@ -447,6 +447,7 @@ static char *setup_grammars_pocketsphinx(struct input_component *component, swit
...
@@ -447,6 +447,7 @@ static char *setup_grammars_pocketsphinx(struct input_component *component, swit
if
(
!
(
component
->
grammar
=
srgs_parse
(
globals
.
parser
,
iks_find_cdata
(
input
,
"grammar"
))))
{
if
(
!
(
component
->
grammar
=
srgs_parse
(
globals
.
parser
,
iks_find_cdata
(
input
,
"grammar"
))))
{
*
stanza_error
=
STANZA_ERROR_BAD_REQUEST
;
*
stanza_error
=
STANZA_ERROR_BAD_REQUEST
;
*
error_detail
=
"Failed to parse grammar body"
;
*
error_detail
=
"Failed to parse grammar body"
;
switch_safe_free
(
grammar
.
data
);
return
NULL
;
return
NULL
;
}
}
...
@@ -454,6 +455,7 @@ static char *setup_grammars_pocketsphinx(struct input_component *component, swit
...
@@ -454,6 +455,7 @@ static char *setup_grammars_pocketsphinx(struct input_component *component, swit
if
(
!
jsgf_path
)
{
if
(
!
jsgf_path
)
{
*
stanza_error
=
STANZA_ERROR_BAD_REQUEST
;
*
stanza_error
=
STANZA_ERROR_BAD_REQUEST
;
*
error_detail
=
"Grammar conversion to JSGF error"
;
*
error_detail
=
"Grammar conversion to JSGF error"
;
switch_safe_free
(
grammar
.
data
);
return
NULL
;
return
NULL
;
}
}
...
@@ -483,6 +485,7 @@ static char *setup_grammars_unimrcp(struct input_component *component, switch_co
...
@@ -483,6 +485,7 @@ static char *setup_grammars_unimrcp(struct input_component *component, switch_co
switch_mutex_lock
(
component
->
handler
->
mutex
);
switch_mutex_lock
(
component
->
handler
->
mutex
);
*
stanza_error
=
STANZA_ERROR_INTERNAL_SERVER_ERROR
;
*
stanza_error
=
STANZA_ERROR_INTERNAL_SERVER_ERROR
;
*
error_detail
=
"Failed to initialize recognizer"
;
*
error_detail
=
"Failed to initialize recognizer"
;
switch_safe_free
(
grammar_uri_list
.
data
);
return
NULL
;
return
NULL
;
}
}
switch_mutex_lock
(
component
->
handler
->
mutex
);
switch_mutex_lock
(
component
->
handler
->
mutex
);
...
...
src/mod/event_handlers/mod_rayo/rayo_output_component.c
浏览文件 @
35d44c3f
...
@@ -518,6 +518,11 @@ static switch_status_t next_file(switch_file_handle_t *handle)
...
@@ -518,6 +518,11 @@ static switch_status_t next_file(switch_file_handle_t *handle)
struct
rayo_file_context
*
context
=
handle
->
private_info
;
struct
rayo_file_context
*
context
=
handle
->
private_info
;
struct
output_component
*
output
=
context
->
component
?
OUTPUT_COMPONENT
(
context
->
component
)
:
NULL
;
struct
output_component
*
output
=
context
->
component
?
OUTPUT_COMPONENT
(
context
->
component
)
:
NULL
;
if
(
!
output
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Missing output component!
\n
"
);
return
SWITCH_STATUS_FALSE
;
}
top:
top:
if
(
switch_test_flag
((
&
context
->
fh
),
SWITCH_FILE_OPEN
))
{
if
(
switch_test_flag
((
&
context
->
fh
),
SWITCH_FILE_OPEN
))
{
...
@@ -1045,8 +1050,7 @@ static switch_status_t fileman_file_read(switch_file_handle_t *handle, void *dat
...
@@ -1045,8 +1050,7 @@ static switch_status_t fileman_file_read(switch_file_handle_t *handle, void *dat
//switch_log_printf(SWITCH_CHANNEL_UUID_LOG(context->uuid), SWITCH_LOG_DEBUG, "Read file %"SWITCH_SIZE_T_FMT" bytes\n", o_len * 2);
//switch_log_printf(SWITCH_CHANNEL_UUID_LOG(context->uuid), SWITCH_LOG_DEBUG, "Read file %"SWITCH_SIZE_T_FMT" bytes\n", o_len * 2);
/* add file data to audio bufer */
/* add file data to audio bufer */
read_bytes
=
switch_buffer_write
(
fh
->
audio_buffer
,
context
->
abuf
,
o_len
*
2
);
switch_buffer_write
(
fh
->
audio_buffer
,
context
->
abuf
,
o_len
*
2
);
//switch_log_printf(SWITCH_CHANNEL_UUID_LOG(context->uuid), SWITCH_LOG_DEBUG, "Write audio frame %"SWITCH_SIZE_T_FMT" bytes\n", read_bytes);
read_bytes
=
switch_buffer_read
(
fh
->
audio_buffer
,
context
->
abuf
,
*
len
*
2
);
read_bytes
=
switch_buffer_read
(
fh
->
audio_buffer
,
context
->
abuf
,
*
len
*
2
);
o_len
=
read_bytes
/
2
;
o_len
=
read_bytes
/
2
;
...
@@ -1114,7 +1118,6 @@ static switch_status_t fileman_file_read(switch_file_handle_t *handle, void *dat
...
@@ -1114,7 +1118,6 @@ static switch_status_t fileman_file_read(switch_file_handle_t *handle, void *dat
if
(
wrote_len
<
new_len
)
{
if
(
wrote_len
<
new_len
)
{
switch_size_t
r_len
=
new_len
-
wrote_len
;
switch_size_t
r_len
=
new_len
-
wrote_len
;
switch_buffer_write
(
fh
->
sp_audio_buffer
,
bp
,
r_len
*
2
);
switch_buffer_write
(
fh
->
sp_audio_buffer
,
bp
,
r_len
*
2
);
wrote_len
+=
r_len
;
}
}
continue
;
continue
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论