mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine code:优化edge模式回源播放线程启动流程
This commit is contained in:
parent
5f77724021
commit
a5a9f7c8c5
4 changed files with 10 additions and 26 deletions
|
@ -765,7 +765,7 @@ SrsSource* SrsSource::fetch(SrsRequest* r)
|
|||
SrsSource* SrsSource::fetch(std::string vhost, std::string app, std::string stream)
|
||||
{
|
||||
SrsSource* source = NULL;
|
||||
string stream_url = srs_generate_stream_url(vhost, app, stream);
|
||||
string stream_url = srs_generate_stream_url(vhost, app, stream);
|
||||
|
||||
if (pool.find(stream_url) == pool.end()) {
|
||||
return NULL;
|
||||
|
@ -2135,6 +2135,15 @@ int SrsSource::create_consumer(SrsConsumer*& consumer, bool ds, bool dm, bool dg
|
|||
} else {
|
||||
srs_trace("create consumer, ignore gop cache, jitter=%d", jitter_algorithm);
|
||||
}
|
||||
|
||||
// for edge, when play edge stream, check the state
|
||||
if (_srs_config->get_vhost_is_edge(_req->vhost)) {
|
||||
// notice edge to start for the first client.
|
||||
if ((ret = play_edge->on_client_play()) != ERROR_SUCCESS) {
|
||||
srs_error("notice edge start play stream failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -2163,11 +2172,6 @@ SrsRtmpJitterAlgorithm SrsSource::jitter()
|
|||
return jitter_algorithm;
|
||||
}
|
||||
|
||||
int SrsSource::on_edge_start_play()
|
||||
{
|
||||
return play_edge->on_client_play();
|
||||
}
|
||||
|
||||
int SrsSource::on_edge_start_publish()
|
||||
{
|
||||
return publish_edge->on_client_publish();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue