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
2015-07-14 10:43:21 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
99574bb77bac2a0a15f75055cb2596f4a5eae757
99574bb7
1 parent
40c264a3
ignore when no segments for there must no m3u8
显示空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
11 行增加
和
3 行删除
trunk/src/app/srs_app_hls.cpp
trunk/src/app/srs_app_hls.cpp
查看文件 @
99574bb
...
...
@@ -697,7 +697,9 @@ int SrsHlsMuxer::segment_close(string log_desc)
srs_assert
(
it
==
segments
.
end
());
// valid, add to segments if segment duration is ok
if
(
current
->
duration
*
1000
>=
SRS_AUTO_HLS_SEGMENT_MIN_DURATION_MS
)
{
// when too small, it maybe not enough data to play.
// when too large, it maybe timestamp corrupt.
if
(
current
->
duration
*
1000
>=
SRS_AUTO_HLS_SEGMENT_MIN_DURATION_MS
&&
(
int
)
current
->
duration
<=
max_td
)
{
segments
.
push_back
(
current
);
// use async to call the http hooks, for it will cause thread switch.
...
...
@@ -748,7 +750,6 @@ int SrsHlsMuxer::segment_close(string log_desc)
// rename from tmp to real path
std
::
string
tmp_file
=
current
->
full_path
+
".tmp"
;
if
(
should_write_file
)
{
unlink
(
tmp_file
.
c_str
());
if
(
unlink
(
tmp_file
.
c_str
())
<
0
)
{
srs_warn
(
"ignore unlink path failed, file=%s."
,
tmp_file
.
c_str
());
}
...
...
@@ -815,6 +816,11 @@ int SrsHlsMuxer::refresh_m3u8()
{
int
ret
=
ERROR_SUCCESS
;
// no segments, also no m3u8, return.
if
(
segments
.
size
()
==
0
)
{
return
ret
;
}
std
::
string
temp_m3u8
=
m3u8
+
".temp"
;
if
((
ret
=
_refresh_m3u8
(
temp_m3u8
))
==
ERROR_SUCCESS
)
{
if
(
should_write_file
&&
rename
(
temp_m3u8
.
c_str
(),
m3u8
.
c_str
())
<
0
)
{
...
...
@@ -824,7 +830,9 @@ int SrsHlsMuxer::refresh_m3u8()
}
// remove the temp file.
unlink
(
temp_m3u8
.
c_str
());
if
(
unlink
(
temp_m3u8
.
c_str
())
<
0
)
{
srs_warn
(
"ignore remove m3u8 failed, %s"
,
temp_m3u8
.
c_str
());
}
return
ret
;
}
...
...
请
注册
或
登录
后发表评论