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:
parent
cab88dfe70
commit
71895a4da6
1 changed files with 717 additions and 713 deletions
6
trunk/src/core/srs_core_encoder.cpp
Normal file → Executable file
6
trunk/src/core/srs_core_encoder.cpp
Normal file → Executable file
|
@ -448,8 +448,12 @@ void SrsFFMPEG::stop()
|
||||||
srs_warn("kill the encoder failed, ignored. pid=%d", pid);
|
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;
|
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);
|
srs_warn("wait the encoder quit failed, ignored. pid=%d", pid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue