正在显示
1 个修改的文件
包含
5 行增加
和
1 行删除
trunk/src/core/srs_core_encoder.cpp
100644 → 100755
@@ -448,8 +448,12 @@ void SrsFFMPEG::stop() | @@ -448,8 +448,12 @@ void SrsFFMPEG::stop() | ||
448 | srs_warn("kill the encoder failed, ignored. pid=%d", pid); | 448 | srs_warn("kill the encoder failed, ignored. pid=%d", pid); |
449 | } | 449 | } |
450 | 450 | ||
451 | + // wait for the ffmpeg to quit. | ||
452 | + // ffmpeg will gracefully quit if signal is: | ||
453 | + // 1) SIGHUP 2) SIGINT 3) SIGQUIT | ||
454 | + // other signals, directly exit(123). | ||
451 | int status = 0; | 455 | int status = 0; |
452 | - if (waitpid(pid, &status, WNOHANG) < 0) { | 456 | + if (waitpid(pid, &status, 0) < 0) { |
453 | srs_warn("wait the encoder quit failed, ignored. pid=%d", pid); | 457 | srs_warn("wait the encoder quit failed, ignored. pid=%d", pid); |
454 | } | 458 | } |
455 | 459 |
-
请 注册 或 登录 后发表评论