1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

fix the ffmpeg kill bug, wait until ffmpeg quit.

This commit is contained in:
winlin 2013-12-06 14:07:37 +08:00
parent cab88dfe70
commit 71895a4da6

6
trunk/src/core/srs_core_encoder.cpp Normal file → Executable file
View file

@ -448,8 +448,12 @@ void SrsFFMPEG::stop()
srs_warn("kill the encoder failed, ignored. pid=%d", pid);
}
// wait for the ffmpeg to quit.
// ffmpeg will gracefully quit if signal is:
// 1) SIGHUP 2) SIGINT 3) SIGQUIT
// other signals, directly exit(123).
int status = 0;
if (waitpid(pid, &status, WNOHANG) < 0) {
if (waitpid(pid, &status, 0) < 0) {
srs_warn("wait the encoder quit failed, ignored. pid=%d", pid);
}