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-05-13 11:16:53 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7004510cc7b514419763a09214e6f3ccefbde1b4
7004510c
1 parent
74e6e289
fix ffmpeg log fd leak, always close log_fd. 0.9.94
显示空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
4 行增加
和
9 行删除
trunk/src/app/srs_app_ffmpeg.cpp
trunk/src/app/srs_app_ffmpeg.hpp
trunk/src/core/srs_core.hpp
trunk/src/app/srs_app_ffmpeg.cpp
查看文件 @
7004510
...
...
@@ -64,8 +64,6 @@ SrsFFMPEG::SrsFFMPEG(std::string ffmpeg_bin)
abitrate
=
0
;
asample_rate
=
0
;
achannels
=
0
;
log_fd
=
-
1
;
}
SrsFFMPEG
::~
SrsFFMPEG
()
...
...
@@ -375,6 +373,7 @@ int SrsFFMPEG::start()
// child process: ffmpeg encoder engine.
if
(
pid
==
0
)
{
// redirect logs to file.
int
log_fd
=
-
1
;
int
flags
=
O_CREAT
|
O_WRONLY
|
O_APPEND
;
mode_t
mode
=
S_IRUSR
|
S_IWUSR
|
S_IRGRP
|
S_IWGRP
|
S_IROTH
;
if
((
log_fd
=
::
open
(
log_file
.
c_str
(),
flags
,
mode
))
<
0
)
{
...
...
@@ -392,6 +391,8 @@ int SrsFFMPEG::start()
srs_error
(
"dup2 encoder file failed. ret=%d"
,
ret
);
return
ret
;
}
// close log fd
::
close
(
log_fd
);
// close other fds
// TODO: do in right way.
for
(
int
i
=
3
;
i
<
1024
;
i
++
)
{
...
...
@@ -456,11 +457,6 @@ int SrsFFMPEG::cycle()
void
SrsFFMPEG
::
stop
()
{
if
(
log_fd
>
0
)
{
::
close
(
log_fd
);
log_fd
=
-
1
;
}
if
(
!
started
)
{
return
;
}
...
...
trunk/src/app/srs_app_ffmpeg.hpp
查看文件 @
7004510
...
...
@@ -48,7 +48,6 @@ private:
pid_t
pid
;
private
:
std
::
string
log_file
;
int
log_fd
;
private
:
std
::
string
ffmpeg
;
std
::
string
_iparams
;
...
...
trunk/src/core/srs_core.hpp
100644 → 100755
查看文件 @
7004510
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR "0"
#define VERSION_MINOR "9"
#define VERSION_REVISION "9
3"
#define VERSION_REVISION "9
4"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info.
#define RTMP_SIG_SRS_KEY "srs"
...
...
请
注册
或
登录
后发表评论