Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2014-12-05 11:31:06 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4c1d5c0d1e8d93679e5c042579810fe66c109976
4c1d5c0d
1 parent
fad6074a
refine the log for mw and mr. 2.0.55
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
10 行增加
和
6 行删除
trunk/src/app/srs_app_recv_thread.cpp
trunk/src/app/srs_app_rtmp_conn.cpp
trunk/src/app/srs_app_recv_thread.cpp
查看文件 @
4c1d5c0
...
...
@@ -433,17 +433,21 @@ void SrsPublishRecvThread::set_socket_buffer(int sleep_ms)
// 2000*5000/8=1250000B(about 1220KB).
int
kbps
=
5000
;
int
socket_buffer_size
=
sleep_ms
*
kbps
/
8
;
int
fd
=
mr_fd
;
int
onb_rbuf
=
0
;
socklen_t
sock_buf_size
=
sizeof
(
int
);
getsockopt
(
fd
,
SOL_SOCKET
,
SO_RCVBUF
,
&
onb_rbuf
,
&
sock_buf_size
);
// socket recv buffer, system will double it.
int
nb_rbuf
=
socket_buffer_size
/
2
;
socklen_t
sock_buf_size
=
sizeof
(
int
);
if
(
setsockopt
(
mr_fd
,
SOL_SOCKET
,
SO_RCVBUF
,
&
nb_rbuf
,
sock_buf_size
)
<
0
)
{
if
(
setsockopt
(
fd
,
SOL_SOCKET
,
SO_RCVBUF
,
&
nb_rbuf
,
sock_buf_size
)
<
0
)
{
srs_warn
(
"set sock SO_RCVBUF=%d failed."
,
nb_rbuf
);
}
getsockopt
(
mr_
fd
,
SOL_SOCKET
,
SO_RCVBUF
,
&
nb_rbuf
,
&
sock_buf_size
);
getsockopt
(
fd
,
SOL_SOCKET
,
SO_RCVBUF
,
&
nb_rbuf
,
&
sock_buf_size
);
srs_trace
(
"merged read sockbuf=%d, actual=%d, sleep %d when nread<=%d"
,
socket_buffer_size
,
nb_rbuf
,
sleep_ms
,
SRS_MR_SMALL_BYTES
);
srs_trace
(
"mr change sleep %d=>%d, erbuf=%d, rbuf %d=>%d, sbytes=%d"
,
mr_sleep
,
sleep_ms
,
socket_buffer_size
,
onb_rbuf
,
nb_rbuf
,
SRS_MR_SMALL_BYTES
);
rtmp
->
set_recv_buffer
(
nb_rbuf
);
}
...
...
trunk/src/app/srs_app_rtmp_conn.cpp
查看文件 @
4c1d5c0
...
...
@@ -1023,7 +1023,7 @@ void SrsRtmpConn::change_mw_sleep(int sleep_ms)
}
getsockopt
(
fd
,
SOL_SOCKET
,
SO_SNDBUF
,
&
nb_sbuf
,
&
sock_buf_size
);
srs_trace
(
"mw change
d
%d=>%d, max_msgs=%d, esbuf=%d, sbuf %d=>%d"
,
srs_trace
(
"mw change
sleep
%d=>%d, max_msgs=%d, esbuf=%d, sbuf %d=>%d"
,
mw_sleep
,
sleep_ms
,
SRS_PERF_MW_MSGS
,
socket_buffer_size
,
onb_sbuf
,
nb_sbuf
);
...
...
请
注册
或
登录
后发表评论