mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 11:51:57 +00:00
parent
5f7d23f123
commit
9dad53691e
2 changed files with 6 additions and 5 deletions
|
@ -6761,7 +6761,7 @@ int SrsConfig::get_srto_recv_latency() {
|
|||
}
|
||||
|
||||
int SrsConfig::get_srto_peer_latency() {
|
||||
static int DEFAULT = 120;
|
||||
static int DEFAULT = 0;
|
||||
SrsConfDirective* conf = root->get("srt_server");
|
||||
if (!conf) {
|
||||
return DEFAULT;
|
||||
|
|
|
@ -26,7 +26,8 @@ srt_server::~srt_server()
|
|||
}
|
||||
|
||||
int srt_server::init_srt_parameter() {
|
||||
const int DEF_LATENCY = 188*7;
|
||||
const int DEF_RECV_LATENCY = 120;
|
||||
const int DEF_PEER_LATENCY = 0;
|
||||
|
||||
int opt_len = sizeof(int);
|
||||
|
||||
|
@ -53,17 +54,17 @@ int srt_server::init_srt_parameter() {
|
|||
srt_setsockopt(_server_socket, 0, SRTO_PAYLOADSIZE, &payload_size, opt_len);
|
||||
|
||||
int latency = _srs_config->get_srto_latency();
|
||||
if (DEF_LATENCY != latency) {
|
||||
if (DEF_RECV_LATENCY != latency) {
|
||||
srt_setsockopt(_server_socket, 0, SRTO_LATENCY, &latency, opt_len);
|
||||
}
|
||||
|
||||
int recv_latency = _srs_config->get_srto_recv_latency();
|
||||
if (DEF_LATENCY != recv_latency) {
|
||||
if (DEF_RECV_LATENCY != recv_latency) {
|
||||
srt_setsockopt(_server_socket, 0, SRTO_RCVLATENCY, &recv_latency, opt_len);
|
||||
}
|
||||
|
||||
int peer_latency = _srs_config->get_srto_peer_latency();
|
||||
if (DEF_LATENCY != peer_latency) {
|
||||
if (DEF_PEER_LATENCY != peer_latency) {
|
||||
srt_setsockopt(_server_socket, 0, SRTO_PEERLATENCY, &recv_latency, opt_len);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue