mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
Refine SRS_CONSTS_RTMP_PULSE_TMMS in time unit
This commit is contained in:
parent
695d430dcf
commit
5b0e0d0838
9 changed files with 12 additions and 12 deletions
|
@ -193,7 +193,7 @@ srs_error_t SrsDynamicHttpConn::do_proxy(ISrsHttpResponseReader* rr, SrsFlvDecod
|
|||
srs_freep(sdk);
|
||||
|
||||
int64_t cto = SRS_CONSTS_RTMP_TMMS;
|
||||
int64_t sto = SRS_CONSTS_RTMP_PULSE_TMMS;
|
||||
int64_t sto = srsu2ms(SRS_CONSTS_RTMP_PULSE);
|
||||
sdk = new SrsSimpleRtmpClient(output, cto, sto);
|
||||
|
||||
if ((err = sdk->connect()) != srs_success) {
|
||||
|
|
|
@ -115,7 +115,7 @@ srs_error_t SrsEdgeRtmpUpstream::connect(SrsRequest* r, SrsLbRoundRobin* lb)
|
|||
|
||||
srs_freep(sdk);
|
||||
int64_t cto = srsu2ms(SRS_EDGE_INGESTER_TMMS);
|
||||
int64_t sto = SRS_CONSTS_RTMP_PULSE_TMMS;
|
||||
int64_t sto = srsu2ms(SRS_CONSTS_RTMP_PULSE);
|
||||
sdk = new SrsSimpleRtmpClient(url, cto, sto);
|
||||
|
||||
if ((err = sdk->connect()) != srs_success) {
|
||||
|
@ -532,7 +532,7 @@ srs_error_t SrsEdgeForwarder::do_cycle()
|
|||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
sdk->set_recv_timeout(SRS_CONSTS_RTMP_PULSE_TMMS);
|
||||
sdk->set_recv_timeout(srsu2ms(SRS_CONSTS_RTMP_PULSE));
|
||||
|
||||
SrsPithyPrint* pprint = SrsPithyPrint::create_edge();
|
||||
SrsAutoFree(SrsPithyPrint, pprint);
|
||||
|
|
|
@ -241,7 +241,7 @@ srs_error_t SrsForwarder::forward()
|
|||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
sdk->set_recv_timeout(SRS_CONSTS_RTMP_PULSE_TMMS);
|
||||
sdk->set_recv_timeout(srsu2ms(SRS_CONSTS_RTMP_PULSE));
|
||||
|
||||
SrsPithyPrint* pprint = SrsPithyPrint::create_forwarder();
|
||||
SrsAutoFree(SrsPithyPrint, pprint);
|
||||
|
|
|
@ -155,9 +155,9 @@ srs_error_t SrsBufferCache::cycle()
|
|||
}
|
||||
|
||||
if (count <= 0) {
|
||||
srs_info("http: sleep %dms for no msg", SRS_CONSTS_RTMP_PULSE_TMMS);
|
||||
srs_info("http: sleep %dms for no msg", srsu2msi(SRS_CONSTS_RTMP_PULSE));
|
||||
// directly use sleep, donot use consumer wait.
|
||||
srs_usleep(SRS_CONSTS_RTMP_PULSE_TMMS * SRS_UTIME_MILLISECONDS);
|
||||
srs_usleep(SRS_CONSTS_RTMP_PULSE);
|
||||
|
||||
// ignore when nothing got.
|
||||
continue;
|
||||
|
@ -165,7 +165,7 @@ srs_error_t SrsBufferCache::cycle()
|
|||
|
||||
if (pprint->can_print()) {
|
||||
srs_trace("-> " SRS_CONSTS_LOG_HTTP_STREAM_CACHE " 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, srsu2msi(SRS_CONSTS_RTMP_PULSE));
|
||||
}
|
||||
|
||||
// free the messages.
|
||||
|
|
|
@ -616,7 +616,7 @@ srs_error_t SrsMpegtsOverUdp::connect()
|
|||
}
|
||||
|
||||
int64_t cto = SRS_CONSTS_RTMP_TMMS;
|
||||
int64_t sto = SRS_CONSTS_RTMP_PULSE_TMMS;
|
||||
int64_t sto = srsu2ms(SRS_CONSTS_RTMP_PULSE);
|
||||
sdk = new SrsSimpleRtmpClient(output, cto, sto);
|
||||
|
||||
if ((err = sdk->connect()) != srs_success) {
|
||||
|
|
|
@ -650,7 +650,7 @@ srs_error_t SrsRtspConn::connect()
|
|||
|
||||
// connect host.
|
||||
int64_t cto = SRS_CONSTS_RTMP_TMMS;
|
||||
int64_t sto = SRS_CONSTS_RTMP_PULSE_TMMS;
|
||||
int64_t sto = srsu2ms(SRS_CONSTS_RTMP_PULSE);
|
||||
sdk = new SrsSimpleRtmpClient(url, cto, sto);
|
||||
|
||||
if ((err = sdk->connect()) != srs_success) {
|
||||
|
|
|
@ -536,7 +536,7 @@ srs_error_t SrsConsumer::dump_packets(SrsMessageArray* msgs, int& count)
|
|||
void SrsConsumer::wait(int nb_msgs, srs_utime_t msgs_duration)
|
||||
{
|
||||
if (paused) {
|
||||
srs_usleep(SRS_CONSTS_RTMP_PULSE_TMMS * 1000);
|
||||
srs_usleep(SRS_CONSTS_RTMP_PULSE);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
// if timeout, we generally ignore and send the data to client,
|
||||
// generally, it's the pulse time for data seding.
|
||||
// @remark, recomment to 500ms.
|
||||
#define SRS_CONSTS_RTMP_PULSE_TMMS (500)
|
||||
#define SRS_CONSTS_RTMP_PULSE (500 * SRS_UTIME_MILLISECONDS)
|
||||
|
||||
/**
|
||||
* max rtmp header size:
|
||||
|
|
|
@ -1277,7 +1277,7 @@ int SrsIngestHlsOutput::connect()
|
|||
|
||||
// connect host.
|
||||
int64_t cto = SRS_CONSTS_RTMP_TMMS;
|
||||
int64_t sto = SRS_CONSTS_RTMP_PULSE_TMMS;
|
||||
int64_t sto = srsu2ms(SRS_CONSTS_RTMP_PULSE);
|
||||
sdk = new SrsBasicRtmpClient(url, cto, sto);
|
||||
|
||||
if ((err = sdk->connect()) != srs_success) {
|
||||
|
|
Loading…
Reference in a new issue