Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2015-12-15 16:25:21 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
69d191e53fd6cf87b2c04fa055bd652b28a8cf90
69d191e5
1 parent
40457e6c
refine the hls error log.
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
19 行增加
和
22 行删除
trunk/src/app/srs_app_source.cpp
trunk/src/app/srs_app_source.cpp
查看文件 @
69d191e
...
...
@@ -1548,6 +1548,24 @@ int SrsSource::on_audio(SrsCommonMessage* shared_audio)
return
ret
;
}
bool
srs_hls_can_continue
(
int
ret
,
SrsSharedPtrMessage
*
sh
,
SrsSharedPtrMessage
*
msg
)
{
// only continue for decode error.
if
(
ret
!=
ERROR_HLS_DECODE_ERROR
)
{
return
false
;
}
// when video size equals to sequence header,
// the video actually maybe a sequence header,
// continue to make ffmpeg happy.
if
(
sh
&&
sh
->
size
==
msg
->
size
)
{
srs_warn
(
"the msg is actually a sequence header, ignore this packet."
);
return
true
;
}
return
false
;
}
int
SrsSource
::
on_audio_imp
(
SrsSharedPtrMessage
*
msg
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -1608,9 +1626,7 @@ int SrsSource::on_audio_imp(SrsSharedPtrMessage* msg)
// ignore.
ret
=
ERROR_SUCCESS
;
}
else
if
(
srs_config_hls_is_on_error_continue
(
hls_error_strategy
))
{
// compare the sequence header with audio, continue when it's actually an sequence header.
if
(
ret
==
ERROR_HLS_DECODE_ERROR
&&
cache_sh_audio
&&
cache_sh_audio
->
size
==
msg
->
size
)
{
srs_warn
(
"the audio is actually a sequence header, ignore this packet."
);
if
(
srs_hls_can_continue
(
ret
,
cache_sh_audio
,
msg
))
{
ret
=
ERROR_SUCCESS
;
}
else
{
srs_warn
(
"hls continue audio failed. ret=%d"
,
ret
);
...
...
@@ -1763,23 +1779,6 @@ int SrsSource::on_video(SrsCommonMessage* shared_video)
return
ret
;
}
bool
srs_hls_can_continue
(
int
ret
,
SrsSharedPtrMessage
*
sh
,
SrsSharedPtrMessage
*
video
)
{
// only continue for decode error.
if
(
ret
!=
ERROR_HLS_DECODE_ERROR
)
{
return
false
;
}
// when video size equals to sequence header,
// the video actually maybe a sequence header,
// continue to make ffmpeg happy.
if
(
sh
&&
sh
->
size
==
video
->
size
)
{
return
true
;
}
return
false
;
}
int
SrsSource
::
on_video_imp
(
SrsSharedPtrMessage
*
msg
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -1843,9 +1842,7 @@ int SrsSource::on_video_imp(SrsSharedPtrMessage* msg)
// ignore.
ret
=
ERROR_SUCCESS
;
}
else
if
(
srs_config_hls_is_on_error_continue
(
hls_error_strategy
))
{
// compare the sequence header with video, continue when it's actually an sequence header.
if
(
srs_hls_can_continue
(
ret
,
cache_sh_video
,
msg
))
{
srs_warn
(
"the video is actually a sequence header, ignore this packet."
);
ret
=
ERROR_SUCCESS
;
}
else
{
srs_warn
(
"hls continue video failed. ret=%d"
,
ret
);
...
...
请
注册
或
登录
后发表评论