Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
03cc800f
提交
03cc800f
authored
7月 24, 2008
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
omfg
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@9173
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
94855716
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
22 行增加
和
15 行删除
+22
-15
layer3.c
src/mod/formats/mod_shout/layer3.c
+3
-0
mod_shout.c
src/mod/formats/mod_shout/mod_shout.c
+19
-15
没有找到文件。
src/mod/formats/mod_shout/layer3.c
浏览文件 @
03cc800f
...
...
@@ -985,12 +985,15 @@ static int III_dequantize_sample(struct mpstr *mp, real xr[SBLIMIT][SSLIMIT], in
getbits
(
mp
,
16
);
/* Dismiss stuffing Bits */
part2remain
-=
16
;
}
if
(
part2remain
>
0
)
getbits
(
mp
,
part2remain
);
#if 0
else if (part2remain < 0) {
debug_printf("mpg123: %d Can't rewind stream by %d bits!\n", -part2remain, __LINE__);
return 1; /* -> error */
}
#endif
return
0
;
}
...
...
src/mod/formats/mod_shout/mod_shout.c
浏览文件 @
03cc800f
...
...
@@ -66,6 +66,7 @@ struct shout_context {
uint8_t
shout_init
;
uint32_t
prebuf
;
int
lame_ready
;
int
eof
;
};
typedef
struct
shout_context
shout_context_t
;
...
...
@@ -232,11 +233,12 @@ static size_t decode_fd(shout_context_t *context, void *data, size_t bytes)
size_t
used
;
size_t
lp
;
size_t
rb
=
0
;
while
(
switch_buffer_inuse
(
context
->
audio_buffer
)
<
bytes
)
{
while
(
!
context
->
eof
&&
switch_buffer_inuse
(
context
->
audio_buffer
)
<
bytes
)
{
lp
=
sizeof
(
inbuf
);
if
((
switch_file_read
(
context
->
fd
,
inbuf
,
&
lp
)
!=
SWITCH_STATUS_SUCCESS
)
||
lp
==
0
)
{
goto
error
;
context
->
eof
++
;
goto
end
;
}
inlen
=
(
int
)
lp
;
...
...
@@ -253,7 +255,7 @@ static size_t decode_fd(shout_context_t *context, void *data, size_t bytes)
do
{
decode_status
=
decodeMP3
(
&
context
->
mp
,
in
,
inlen
,
out
,
outlen
,
&
dlen
);
if
(
context
->
err
)
{
goto
error
;
}
...
...
@@ -274,22 +276,20 @@ static size_t decode_fd(shout_context_t *context, void *data, size_t bytes)
out
=
context
->
decode_buf
;
outlen
=
sizeof
(
context
->
decode_buf
);
usedlen
=
0
;
continue
;
}
if
(
decode_status
==
MP3_ERR
)
{
}
else
if
(
decode_status
==
MP3_ERR
)
{
if
(
++
context
->
mp3err
>=
5
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Decoder Error!
\n
"
);
goto
error
;
context
->
eof
++
;
goto
end
;
}
dlen
=
0
;
continue
;
}
context
->
mp3err
=
0
;
usedlen
+=
dlen
;
out
+=
dlen
;
outlen
-=
dlen
;
...
...
@@ -309,16 +309,20 @@ static size_t decode_fd(shout_context_t *context, void *data, size_t bytes)
}
}
end:
used
=
switch_buffer_inuse
(
context
->
audio_buffer
);
if
(
done
||
used
>=
bytes
)
{
rb
=
switch_buffer_read
(
context
->
audio_buffer
,
data
,
used
);
if
(
context
->
eof
||
done
||
used
>=
bytes
)
{
if
(
!
(
rb
=
switch_buffer_read
(
context
->
audio_buffer
,
data
,
bytes
)))
{
goto
error
;
}
return
rb
;
}
return
0
;
error:
error:
switch_mutex_lock
(
context
->
audio_mutex
);
context
->
err
++
;
switch_mutex_unlock
(
context
->
audio_mutex
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论