1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00
edge模式,重新从源站拉流时,导致forwarders异常
This commit is contained in:
zhengfl 2015-07-08 11:47:34 +08:00
parent f39faa78bb
commit 120033e0a2

13
trunk/src/app/srs_app_edge.cpp Normal file → Executable file
View file

@ -94,6 +94,13 @@ int SrsEdgeIngester::initialize(SrsSource* source, SrsPlayEdge* edge, SrsRequest
int SrsEdgeIngester::start()
{
int ret = ERROR_SUCCESS;
if ((ret = _source->on_publish()) != ERROR_SUCCESS) {
srs_error("edge pull stream then publish to edge failed. ret=%d", ret);
return ret;
}
return pthread->start();
}
@ -114,6 +121,7 @@ void SrsEdgeIngester::stop()
int SrsEdgeIngester::cycle()
{
int ret = ERROR_SUCCESS;
_source->on_source_id_changed(_srs_context->get_id());
std::string ep_server, ep_port;
if ((ret = connect_server(ep_server, ep_port)) != ERROR_SUCCESS) {
@ -144,11 +152,6 @@ int SrsEdgeIngester::cycle()
return ret;
}
if ((ret = _source->on_publish()) != ERROR_SUCCESS) {
srs_error("edge pull stream then publish to edge failed. ret=%d", ret);
return ret;
}
if ((ret = _edge->on_ingest_play()) != ERROR_SUCCESS) {
return ret;
}