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-07-17 14:05:34 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3b65af9bd20354d44f4147deca88bb1e4a2cc02a
3b65af9b
1 parent
99db2888
fix the hstrs bug on edge.
显示空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
14 行增加
和
3 行删除
trunk/src/app/srs_app_http_stream.cpp
trunk/src/app/srs_app_http_stream.cpp
查看文件 @
3b65af9
...
...
@@ -23,6 +23,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_http_stream.hpp>
#define SRS_STREAM_CACHE_CYCLE_SECONDS 30
#if defined(SRS_AUTO_HTTP_CORE)
#include <sys/types.h>
...
...
@@ -107,6 +109,7 @@ int SrsStreamCache::cycle()
// TODO: FIXME: support reload.
if
(
fast_cache
<=
0
)
{
st_sleep
(
SRS_STREAM_CACHE_CYCLE_SECONDS
);
return
ret
;
}
...
...
@@ -1139,8 +1142,10 @@ int SrsHttpStreamServer::hijack(ISrsHttpMessage* request, ISrsHttpHandler** ph)
}
// hstrs not enabled, ignore.
// for origin: generally set hstrs to 'off' and mount while stream is pushed to origin.
// for edge: must set hstrs to 'on' so that it could trigger rtmp stream before mount.
// for origin, the http stream will be mount already when publish,
// so it must never enter this line for stream already mounted.
// for edge, the http stream is trigger by hstrs and mount by it,
// so we only hijack when only edge and hstrs is on.
entry
=
it
->
second
;
if
(
!
entry
->
hstrs
)
{
return
ret
;
...
...
@@ -1177,14 +1182,20 @@ int SrsHttpStreamServer::hijack(ISrsHttpMessage* request, ISrsHttpHandler** ph)
SrsAutoFree
(
SrsRequest
,
r
);
std
::
string
sid
=
r
->
get_stream_url
();
// check if the stream is enabled.
// check whether the http remux is enabled,
// for example, user disable the http flv then reload.
if
(
sflvs
.
find
(
sid
)
!=
sflvs
.
end
())
{
SrsLiveEntry
*
s_entry
=
sflvs
[
sid
];
if
(
!
s_entry
->
stream
->
entry
->
enabled
)
{
// only when the http entry is disabled, check the config whether http flv disable,
// for the http flv edge use hijack to trigger the edge ingester, we always mount it
// eventhough the origin does not exists the specified stream.
if
(
!
_srs_config
->
get_vhost_http_remux_enabled
(
r
->
vhost
))
{
srs_error
(
"stream is disabled, hijack failed. ret=%d"
,
ret
);
return
ret
;
}
}
}
SrsSource
*
s
=
SrsSource
::
fetch
(
r
);
if
(
!
s
)
{
...
...
请
注册
或
登录
后发表评论