mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine the order.
This commit is contained in:
parent
7b2b11e932
commit
1fd83d9314
30 changed files with 985 additions and 751 deletions
|
@ -70,6 +70,7 @@ SrsEdgeIngester::SrsEdgeIngester()
|
|||
origin_index = 0;
|
||||
stream_id = 0;
|
||||
stfd = NULL;
|
||||
curr_origin_server = "";
|
||||
pthread = new SrsReusableThread2("edge-igs", this, SRS_EDGE_INGESTER_SLEEP_US);
|
||||
}
|
||||
|
||||
|
@ -118,6 +119,11 @@ void SrsEdgeIngester::stop()
|
|||
_source->on_unpublish();
|
||||
}
|
||||
|
||||
string SrsEdgeIngester::get_curr_origin()
|
||||
{
|
||||
return curr_origin_server;
|
||||
}
|
||||
|
||||
int SrsEdgeIngester::cycle()
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
@ -205,7 +211,7 @@ int SrsEdgeIngester::ingest()
|
|||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -352,9 +358,9 @@ int SrsEdgeIngester::connect_server(string& ep_server, string& ep_port)
|
|||
}
|
||||
|
||||
// select the origin.
|
||||
std::string server = conf->args.at(origin_index % conf->args.size());
|
||||
std::string server = curr_origin_server = conf->args.at(origin_index % conf->args.size());
|
||||
origin_index = (origin_index + 1) % conf->args.size();
|
||||
|
||||
|
||||
std::string s_port = SRS_CONSTS_RTMP_DEFAULT_PORT;
|
||||
int port = ::atoi(SRS_CONSTS_RTMP_DEFAULT_PORT);
|
||||
size_t pos = server.find(":");
|
||||
|
@ -754,6 +760,11 @@ void SrsPlayEdge::on_all_client_stop()
|
|||
}
|
||||
}
|
||||
|
||||
string SrsPlayEdge::get_curr_origin()
|
||||
{
|
||||
return ingester->get_curr_origin();
|
||||
}
|
||||
|
||||
int SrsPlayEdge::on_ingest_play()
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue