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:06:40 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
0ab64ccd2a74ac49f2c5d19fa55fb7805ab86868
0ab64ccd
2 parents
f6ff1165
40457e6c
merge from srs2.
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
25 行增加
和
7 行删除
trunk/conf/full.conf
trunk/src/app/srs_app_config.cpp
trunk/src/app/srs_app_source.cpp
trunk/conf/full.conf
查看文件 @
0ab64cc
...
...
@@ -928,12 +928,12 @@ vhost with-hls.srs.com {
# default: 60
hls_window
60
;
# the error strategy. canbe:
# ignore, when error ignore and disable hls.
# disconnect, when error disconnect the publish connection.
# continue, when error ignore and continue output hls.
# ignore, disable the hls.
# disconnect, require encoder republish.
# continue, ignore failed try to continue output hls.
# @see https://github.com/ossrs/srs/issues/264
# default: ignore
hls_on_error
ignore
;
# default: continue
hls_on_error
continue
;
# the hls storage: disk, ram or both.
# disk, to write hls m3u8/ts to disk.
# ram, serve m3u8/ts in memory, which use embeded http server to delivery.
...
...
trunk/src/app/srs_app_config.cpp
查看文件 @
0ab64cc
...
...
@@ -6002,7 +6002,8 @@ double SrsConfig::get_hls_window(string vhost)
string
SrsConfig
::
get_hls_on_error
(
string
vhost
)
{
static
string
DEFAULT
=
"ignore"
;
// try to ignore the error.
static
string
DEFAULT
=
"continue"
;
SrsConfDirective
*
conf
=
get_hls
(
vhost
);
if
(
!
conf
)
{
...
...
trunk/src/app/srs_app_source.cpp
查看文件 @
0ab64cc
...
...
@@ -1770,6 +1770,23 @@ 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
;
...
...
@@ -1834,7 +1851,7 @@ int SrsSource::on_video_imp(SrsSharedPtrMessage* msg)
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
(
ret
==
ERROR_HLS_DECODE_ERROR
&&
cache_sh_video
&&
cache_sh_video
->
size
==
msg
->
size
)
{
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
{
...
...
请
注册
或
登录
后发表评论