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-11-13 13:50:45 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
93e5d87463db4ede641344160049e4212624a6ea
93e5d874
2 parents
3084ec49
77cf885d
Merge branch 'srs.master'
显示空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
53 行增加
和
2 行删除
trunk/research/st/srs.c
trunk/src/app/srs_app_rtmp_conn.cpp
trunk/src/app/srs_app_server.cpp
trunk/research/st/srs.c
查看文件 @
93e5d87
...
...
@@ -64,6 +64,47 @@ int sleep_test()
return
0
;
}
void
*
sleep2_func0
(
void
*
arg
)
{
int
sleep_ms
=
100
;
st_utime_t
start
=
st_utime
();
st_usleep
(
sleep_ms
*
1000
);
st_utime_t
end
=
st_utime
();
srs_trace
(
"sleep ok, sleep=%dus, deviation=%dus"
,
(
int
)(
sleep_ms
*
1000
),
(
int
)(
end
-
start
-
sleep_ms
*
1000
));
return
NULL
;
}
void
*
sleep2_func1
(
void
*
arg
)
{
int
sleep_ms
=
250
;
st_utime_t
start
=
st_utime
();
st_usleep
(
sleep_ms
*
1000
);
st_utime_t
end
=
st_utime
();
srs_trace
(
"sleep ok, sleep=%dus, deviation=%dus"
,
(
int
)(
sleep_ms
*
1000
),
(
int
)(
end
-
start
-
sleep_ms
*
1000
));
return
NULL
;
}
int
sleep2_test
()
{
srs_trace
(
"==================================================="
);
srs_trace
(
"sleep2 test: start"
);
st_thread_t
trd0
=
st_thread_create
(
sleep2_func0
,
NULL
,
1
,
0
);
st_thread_t
trd1
=
st_thread_create
(
sleep2_func1
,
NULL
,
1
,
0
);
st_thread_join
(
trd0
,
NULL
);
st_thread_join
(
trd1
,
NULL
);
srs_trace
(
"sleep test: end"
);
exit
(
0
);
return
0
;
}
st_mutex_t
sleep_work_cond
=
NULL
;
void
*
sleep_deviation_func
(
void
*
arg
)
{
...
...
@@ -400,8 +441,8 @@ int main(int argc, char** argv)
return
-
1
;
}
if
(
huge_stack_test
()
<
0
)
{
srs_trace
(
"huge_stack_test failed"
);
if
(
sleep2_test
()
<
0
)
{
srs_trace
(
"sleep2_test failed"
);
return
-
1
;
}
...
...
@@ -415,6 +456,11 @@ int main(int argc, char** argv)
return
-
1
;
}
if
(
huge_stack_test
()
<
0
)
{
srs_trace
(
"huge_stack_test failed"
);
return
-
1
;
}
if
(
thread_test
()
<
0
)
{
srs_trace
(
"thread_test failed"
);
return
-
1
;
...
...
trunk/src/app/srs_app_rtmp_conn.cpp
查看文件 @
93e5d87
...
...
@@ -534,6 +534,10 @@ int SrsRtmpConn::playing(SrsSource* source)
// it's ok, do nothing.
ret
=
ERROR_SUCCESS
;
srs_verbose
(
"recv timeout, ignore. ret=%d"
,
ret
);
// TODO: FIXME: the timeout may caused some dead loop.
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/161
st_usleep
(
0
);
}
else
if
(
ret
!=
ERROR_SUCCESS
)
{
if
(
!
srs_is_client_gracefully_close
(
ret
))
{
srs_error
(
"recv client control message failed. ret=%d"
,
ret
);
...
...
trunk/src/app/srs_app_server.cpp
查看文件 @
93e5d87
...
...
@@ -48,6 +48,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// signal defines.
#define SIGNAL_RELOAD SIGHUP
// nginx also set to 512
#define SERVER_LISTEN_BACKLOG 512
// system interval in ms,
...
...
请
注册
或
登录
后发表评论