1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

for #742, use ms for application clock tbn.

This commit is contained in:
winlin 2017-01-17 12:25:30 +08:00
parent dca9749f37
commit 3fe338d1c5
43 changed files with 437 additions and 435 deletions

View file

@ -54,8 +54,8 @@ using namespace std;
ISrsLog* _srs_log = new ISrsLog();
ISrsThreadContext* _srs_context = new ISrsThreadContext();
// use this default timeout in us, if user not set.
#define SRS_SOCKET_DEFAULT_TIMEOUT 30 * 1000 * 1000LL
// The default socket timeout in ms.
#define SRS_SOCKET_DEFAULT_TMMS (30 * 1000)
/**
* export runtime context.
@ -108,7 +108,7 @@ struct Context
// the aac sequence header.
std::string aac_specific_config;
// user set timeout, in us.
// user set timeout, in ms.
int64_t stimeout;
int64_t rtimeout;
@ -120,7 +120,7 @@ struct Context
h264_sps_pps_sent = false;
h264_sps_changed = false;
h264_pps_changed = false;
rtimeout = stimeout = -1;
rtimeout = stimeout = SRS_CONSTS_NO_TMMS;
}
virtual ~Context() {
srs_freep(req);
@ -580,8 +580,8 @@ int srs_rtmp_set_timeout(srs_rtmp_t rtmp, int recv_timeout_ms, int send_timeout_
Context* context = (Context*)rtmp;
context->stimeout = send_timeout_ms * 1000;
context->rtimeout = recv_timeout_ms * 1000;
context->stimeout = send_timeout_ms;
context->rtimeout = recv_timeout_ms;
context->skt->set_recv_timeout(context->rtimeout);
context->skt->set_send_timeout(context->stimeout);
@ -646,12 +646,12 @@ int srs_rtmp_connect_server(srs_rtmp_t rtmp)
Context* context = (Context*)rtmp;
// set timeout if user not set.
if (context->stimeout == -1) {
context->stimeout = SRS_SOCKET_DEFAULT_TIMEOUT;
if (context->stimeout == SRS_CONSTS_NO_TMMS) {
context->stimeout = SRS_SOCKET_DEFAULT_TMMS;
context->skt->set_send_timeout(context->stimeout);
}
if (context->rtimeout == -1) {
context->rtimeout = SRS_SOCKET_DEFAULT_TIMEOUT;
if (context->rtimeout == SRS_CONSTS_NO_TMMS) {
context->rtimeout = SRS_SOCKET_DEFAULT_TMMS;
context->skt->set_recv_timeout(context->rtimeout);
}