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-01 22:45:45 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0b631ee80df887c96b41528fd2d80c6235de7f71
0b631ee8
1 parent
31eb9bf1
for bug #235, pass timeout to recv thread.
显示空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
10 行增加
和
8 行删除
trunk/src/app/srs_app_recv_thread.cpp
trunk/src/app/srs_app_recv_thread.hpp
trunk/src/app/srs_app_rtmp_conn.cpp
trunk/src/app/srs_app_recv_thread.cpp
查看文件 @
0b631ee
...
...
@@ -34,8 +34,9 @@ ISrsMessageHandler::~ISrsMessageHandler()
{
}
SrsRecvThread
::
SrsRecvThread
(
ISrsMessageHandler
*
msg_handler
,
SrsRtmpServer
*
rtmp_sdk
)
SrsRecvThread
::
SrsRecvThread
(
ISrsMessageHandler
*
msg_handler
,
SrsRtmpServer
*
rtmp_sdk
,
int
timeout_ms
)
{
timeout
=
timeout_ms
;
handler
=
msg_handler
;
rtmp
=
rtmp_sdk
;
trd
=
new
SrsThread
(
this
,
0
,
true
);
...
...
@@ -65,7 +66,7 @@ int SrsRecvThread::cycle()
int
ret
=
ERROR_SUCCESS
;
if
(
!
handler
->
can_handle
())
{
st_usleep
(
SRS_CONSTS_RTMP_PULSE_TIMEOUT_US
);
st_usleep
(
timeout
*
1000
);
return
ret
;
}
...
...
@@ -109,11 +110,11 @@ void SrsRecvThread::on_thread_stop()
rtmp
->
set_auto_response
(
true
);
// reset the timeout to pulse mode.
rtmp
->
set_recv_timeout
(
SRS_CONSTS_RTMP_PULSE_TIMEOUT_US
);
rtmp
->
set_recv_timeout
(
timeout
*
1000
);
}
SrsQueueRecvThread
::
SrsQueueRecvThread
(
SrsRtmpServer
*
rtmp_sdk
)
:
SrsRecvThread
(
this
,
rtmp_sdk
)
SrsQueueRecvThread
::
SrsQueueRecvThread
(
SrsRtmpServer
*
rtmp_sdk
,
int
timeout_ms
)
:
SrsRecvThread
(
this
,
rtmp_sdk
,
timeout_ms
)
{
}
...
...
trunk/src/app/srs_app_recv_thread.hpp
查看文件 @
0b631ee
...
...
@@ -68,8 +68,9 @@ protected:
SrsThread
*
trd
;
ISrsMessageHandler
*
handler
;
SrsRtmpServer
*
rtmp
;
int
timeout
;
public
:
SrsRecvThread
(
ISrsMessageHandler
*
msg_handler
,
SrsRtmpServer
*
rtmp_sdk
);
SrsRecvThread
(
ISrsMessageHandler
*
msg_handler
,
SrsRtmpServer
*
rtmp_sdk
,
int
timeout_ms
);
virtual
~
SrsRecvThread
();
public
:
virtual
int
start
();
...
...
@@ -91,7 +92,7 @@ class SrsQueueRecvThread : virtual public ISrsMessageHandler, virtual public Srs
private
:
std
::
vector
<
SrsMessage
*>
queue
;
public
:
SrsQueueRecvThread
(
SrsRtmpServer
*
rtmp_sdk
);
SrsQueueRecvThread
(
SrsRtmpServer
*
rtmp_sdk
,
int
timeout_ms
);
virtual
~
SrsQueueRecvThread
();
public
:
virtual
bool
empty
();
...
...
trunk/src/app/srs_app_rtmp_conn.cpp
查看文件 @
0b631ee
...
...
@@ -500,7 +500,7 @@ int SrsRtmpConn::playing(SrsSource* source)
// use isolate thread to recv,
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/217
SrsQueueRecvThread
trd
(
rtmp
);
SrsQueueRecvThread
trd
(
rtmp
,
SRS_CONSTS_RTMP_PULSE_TIMEOUT_US
);
// start isolate recv thread.
if
((
ret
=
trd
.
start
())
!=
ERROR_SUCCESS
)
{
...
...
请
注册
或
登录
后发表评论