mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Merge 2.0, for FLV latency
This commit is contained in:
commit
03ac48f8fa
2 changed files with 12 additions and 4 deletions
|
@ -228,6 +228,7 @@ Please select according to languages:
|
||||||
|
|
||||||
### V2 changes
|
### V2 changes
|
||||||
|
|
||||||
|
* v2.0, 2018-08-05, Refine HTTP-FLV latency, support realtime mode. 2.0.252
|
||||||
* v2.0, 2018-08-04, For [#1110][bug #1110], Support params in http callback. 2.0.251
|
* v2.0, 2018-08-04, For [#1110][bug #1110], Support params in http callback. 2.0.251
|
||||||
* v2.0, 2018-08-02, For [#1031][bug #1031], SRS edge support douyu.com. 2.0.250
|
* v2.0, 2018-08-02, For [#1031][bug #1031], SRS edge support douyu.com. 2.0.250
|
||||||
* v2.0, 2018-07-21, Merge [#1119][bug #1119], fix memory leak. 2.0.249
|
* v2.0, 2018-07-21, Merge [#1119][bug #1119], fix memory leak. 2.0.249
|
||||||
|
|
|
@ -493,7 +493,12 @@ srs_error_t SrsLiveStream::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage
|
||||||
if (srs_string_ends_with(entry->pattern, ".flv")) {
|
if (srs_string_ends_with(entry->pattern, ".flv")) {
|
||||||
w->header()->set_content_type("video/x-flv");
|
w->header()->set_content_type("video/x-flv");
|
||||||
#ifdef SRS_PERF_FAST_FLV_ENCODER
|
#ifdef SRS_PERF_FAST_FLV_ENCODER
|
||||||
|
bool realtime = _srs_config->get_realtime_enabled(req->vhost);
|
||||||
|
if (realtime) {
|
||||||
|
enc = new SrsFlvStreamEncoder();
|
||||||
|
} else {
|
||||||
enc = new SrsFastFlvStreamEncoder();
|
enc = new SrsFastFlvStreamEncoder();
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
enc = new SrsFlvStreamEncoder();
|
enc = new SrsFlvStreamEncoder();
|
||||||
#endif
|
#endif
|
||||||
|
@ -552,6 +557,8 @@ srs_error_t SrsLiveStream::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage
|
||||||
SrsHttpMessage* hr = dynamic_cast<SrsHttpMessage*>(r);
|
SrsHttpMessage* hr = dynamic_cast<SrsHttpMessage*>(r);
|
||||||
SrsResponseOnlyHttpConn* hc = dynamic_cast<SrsResponseOnlyHttpConn*>(hr->connection());
|
SrsResponseOnlyHttpConn* hc = dynamic_cast<SrsResponseOnlyHttpConn*>(hr->connection());
|
||||||
|
|
||||||
|
int mw_sleep = _srs_config->get_mw_sleep_ms(req->vhost);
|
||||||
|
|
||||||
SrsHttpRecvThread* trd = new SrsHttpRecvThread(hc);
|
SrsHttpRecvThread* trd = new SrsHttpRecvThread(hc);
|
||||||
SrsAutoFree(SrsHttpRecvThread, trd);
|
SrsAutoFree(SrsHttpRecvThread, trd);
|
||||||
|
|
||||||
|
@ -578,15 +585,15 @@ srs_error_t SrsLiveStream::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage
|
||||||
if (count <= 0) {
|
if (count <= 0) {
|
||||||
srs_info("http: sleep %dms for no msg", SRS_CONSTS_RTMP_PULSE_TMMS);
|
srs_info("http: sleep %dms for no msg", SRS_CONSTS_RTMP_PULSE_TMMS);
|
||||||
// directly use sleep, donot use consumer wait.
|
// directly use sleep, donot use consumer wait.
|
||||||
srs_usleep(SRS_CONSTS_RTMP_PULSE_TMMS * 1000);
|
srs_usleep(mw_sleep);
|
||||||
|
|
||||||
// ignore when nothing got.
|
// ignore when nothing got.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pprint->can_print()) {
|
if (pprint->can_print()) {
|
||||||
srs_info("-> " SRS_CONSTS_LOG_HTTP_STREAM " http: got %d msgs, age=%d, min=%d, mw=%d",
|
srs_trace("-> "SRS_CONSTS_LOG_HTTP_STREAM" http: got %d msgs, age=%d, min=%d, mw=%d",
|
||||||
count, pprint->age(), SRS_PERF_MW_MIN_MSGS, SRS_CONSTS_RTMP_PULSE_TMMS);
|
count, pprint->age(), SRS_PERF_MW_MIN_MSGS, mw_sleep);
|
||||||
}
|
}
|
||||||
|
|
||||||
// sendout all messages.
|
// sendout all messages.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue