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
2013-12-05 23:54:30 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6207a2f19e0827b457bec95532ae0b20ec9bdb2f
6207a2f1
1 parent
b9440df7
fix the rewind bug, support republish by restart the ffmpeg encoder.
显示空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
21 行增加
和
3 行删除
trunk/src/core/srs_core_encoder.cpp
trunk/src/core/srs_core_server.cpp
trunk/src/core/srs_core_encoder.cpp
查看文件 @
6207a2f
...
...
@@ -27,6 +27,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <unistd.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/types.h>
#include <algorithm>
...
...
@@ -415,8 +417,6 @@ int SrsFFMPEG::cycle()
return
ret
;
}
// TODO: to support rewind.
if
(
p
==
0
)
{
srs_info
(
"transcode process pid=%d is running."
,
pid
);
return
ret
;
...
...
@@ -439,7 +439,23 @@ void SrsFFMPEG::stop()
return
;
}
// TODO: kill the ffmpeg process when stop.
// kill the ffmpeg,
// when rewind, upstream will stop publish(unpublish),
// unpublish event will stop all ffmpeg encoders,
// then publish will start all ffmpeg encoders.
if
(
pid
>
0
)
{
if
(
kill
(
pid
,
SIGKILL
)
<
0
)
{
srs_warn
(
"kill the encoder failed, ignored. pid=%d"
,
pid
);
}
int
status
=
0
;
if
(
waitpid
(
pid
,
&
status
,
WNOHANG
)
<
0
)
{
srs_warn
(
"wait the encoder quit failed, ignored. pid=%d"
,
pid
);
}
srs_trace
(
"stop the encoder success. pid=%d"
,
pid
);
pid
=
-
1
;
}
std
::
vector
<
std
::
string
>::
iterator
it
;
it
=
std
::
find
(
_transcoded_url
.
begin
(),
_transcoded_url
.
end
(),
output
);
...
...
trunk/src/core/srs_core_server.cpp
查看文件 @
6207a2f
...
...
@@ -287,6 +287,8 @@ void SrsServer::on_signal(int signo)
if
(
signo
==
SIGNAL_RELOAD
)
{
signal_reload
=
true
;
}
// TODO: handle the SIGINT, SIGTERM.
}
void
SrsServer
::
close_listeners
()
...
...
请
注册
或
登录
后发表评论