mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Refine get_publish_1stpkt_timeout in time unit
This commit is contained in:
parent
d6828a3e58
commit
170872135d
13 changed files with 46 additions and 40 deletions
|
@ -143,7 +143,7 @@ srs_error_t SrsConnection::set_socket_buffer(srs_utime_t buffer_v)
|
|||
// 2000*3000/8=750000B(about 732KB).
|
||||
// 2000*5000/8=1250000B(about 1220KB).
|
||||
int kbps = 4000;
|
||||
int iv = (buffer_v / SRS_UTIME_MILLISECONDS) * kbps / 8;
|
||||
int iv = srsu2ms(buffer_v) * kbps / 8;
|
||||
|
||||
// socket send buffer, system will double it.
|
||||
iv = iv / 2;
|
||||
|
@ -161,7 +161,7 @@ srs_error_t SrsConnection::set_socket_buffer(srs_utime_t buffer_v)
|
|||
return srs_error_new(ERROR_SOCKET_SNDBUF, "getsockopt fd=%d, r0=%d", fd, r0);
|
||||
}
|
||||
|
||||
srs_trace("set fd=%d, SO_SNDBUF=%d=>%d, buffer=%dms", fd, ov, iv, buffer_v / SRS_UTIME_MILLISECONDS);
|
||||
srs_trace("set fd=%d, SO_SNDBUF=%d=>%d, buffer=%dms", fd, ov, iv, srsu2ms(buffer_v));
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue