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-11 17:04:32 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
306f75b267213250a597326c7ba8d76f8a35f52e
306f75b2
1 parent
bf5206d0
Revert "for bug#194, open pipe for each connection."
This reverts commit
ade81bb2
.
显示空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
2 行增加
和
28 行删除
trunk/src/app/srs_app_pipe.cpp
trunk/src/app/srs_app_rtmp_conn.cpp
trunk/src/app/srs_app_pipe.cpp
查看文件 @
306f75b
...
...
@@ -81,7 +81,7 @@ int SrsPipe::active()
int
ret
=
ERROR_SUCCESS
;
int
v
=
0
;
if
(
st_write
(
write
_stfd
,
&
v
,
sizeof
(
int
),
ST_UTIME_NO_TIMEOUT
)
!=
sizeof
(
int
))
{
if
(
st_write
(
read
_stfd
,
&
v
,
sizeof
(
int
),
ST_UTIME_NO_TIMEOUT
)
!=
sizeof
(
int
))
{
ret
=
ERROR_SYSTEM_WRITE_PIPE
;
srs_error
(
"write pipe failed. ret=%d"
,
ret
);
return
ret
;
...
...
trunk/src/app/srs_app_rtmp_conn.cpp
查看文件 @
306f75b
...
...
@@ -516,12 +516,7 @@ int SrsRtmpConn::playing(SrsSource* source)
SrsAutoFree
(
SrsConsumer
,
consumer
);
srs_verbose
(
"consumer created success."
);
// TODO: FIXME: remove it.
rtmp
->
set_recv_timeout
(
SRS_CONSTS_RTMP_PULSE_TIMEOUT_US
);
// disable the timeout.
// TODO: FIXME: maybe can use larger timeout?
rtmp
->
set_recv_timeout
(
ST_UTIME_NO_TIMEOUT
);
rtmp
->
set_send_timeout
(
ST_UTIME_NO_TIMEOUT
);
SrsPithyPrint
pithy_print
(
SRS_CONSTS_STAGE_PLAY_USER
);
...
...
@@ -530,30 +525,12 @@ int SrsRtmpConn::playing(SrsSource* source)
bool
user_specified_duration_to_stop
=
(
req
->
duration
>
0
);
int64_t
starttime
=
-
1
;
pollfd
pds
[
2
];
// poll the client incoming fd.
pds
[
0
].
fd
=
st_netfd_fileno
(
stfd
);
pds
[
0
].
events
=
POLLIN
;
// poll the consumer queue pipe.
pds
[
1
].
fd
=
st_netfd_fileno
(
consumer
->
pipe_fd
());
pds
[
1
].
events
=
POLLIN
;
while
(
true
)
{
// collect elapse for pithy print.
pithy_print
.
elapse
();
pds
[
0
].
revents
=
0
;
pds
[
1
].
revents
=
0
;
// wait for packet incoming or data outgoing.
if
(
st_poll
(
pds
,
2
,
ST_UTIME_NO_TIMEOUT
)
<=
0
)
{
srs_error
(
"st_poll failed."
);
break
;
}
// packet incoming, read from RTMP.
// read from client.
if
(
pds
[
0
].
revents
&
POLLIN
)
{
if
(
true
)
{
SrsMessage
*
msg
=
NULL
;
ret
=
rtmp
->
recv_message
(
&
msg
);
srs_verbose
(
"play loop recv message. ret=%d"
,
ret
);
...
...
@@ -576,8 +553,6 @@ int SrsRtmpConn::playing(SrsSource* source)
}
}
// data outgoing, sendout packets.
if
(
pds
[
1
].
revents
&
POLLIN
)
{
// get messages from consumer.
int
count
=
0
;
if
((
ret
=
consumer
->
dump_packets
(
msgs
.
size
,
msgs
.
msgs
,
count
))
!=
ERROR_SUCCESS
)
{
...
...
@@ -623,7 +598,6 @@ int SrsRtmpConn::playing(SrsSource* source)
return
ret
;
}
}
}
// if duration specified, and exceed it, stop play live.
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/45
...
...
请
注册
或
登录
后发表评论