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
2013-12-01 19:54:52 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
09f9811a97f810cb904efdbaf6bb63b016eceb6c
09f9811a
1 parent
3c8cc487
fix the hls crash bug
显示空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
14 行增加
和
4 行删除
trunk/src/core/srs_core_hls.cpp
trunk/src/core/srs_core_hls.cpp
查看文件 @
09f9811
...
...
@@ -714,6 +714,9 @@ int SrsHls::reopen()
current
->
duration
=
(
stream_dts
-
current
->
segment_start_dts
)
/
90000.0
;
segments
.
push_back
(
current
);
srs_trace
(
"reap ts segment, sequence_no=%d, uri=%s, duration=%.2f, start=%"
PRId64
""
,
current
->
sequence_no
,
current
->
uri
.
c_str
(),
current
->
duration
,
current
->
segment_start_dts
);
// close the muxer of finished segment.
srs_freep
(
current
->
muxer
);
current
=
NULL
;
...
...
@@ -726,19 +729,20 @@ int SrsHls::reopen()
std
::
vector
<
SrsM3u8Segment
*>::
reverse_iterator
it
;
for
(
it
=
segments
.
rbegin
();
it
!=
segments
.
rend
();
++
it
)
{
SrsM3u8Segment
*
segment
=
*
it
;
duration
+=
segment
->
duration
;
// once find the overflow segment, clear all segments before it.
if
((
int
)
duration
>
hls_window
)
{
segment_to_remove
.
push_back
(
segment
);
continue
;
}
duration
+=
segment
->
duration
;
}
if
(
!
segment_to_remove
.
empty
())
{
segments
.
erase
(
segments
.
begin
(),
segments
.
begin
()
+
segment_to_remove
.
size
());
// refresh the m3u8, donot contains the removed ts
if
((
ret
=
refresh_m3u8
())
!=
ERROR_SUCCESS
)
{
return
ret
;
}
ret
=
refresh_m3u8
();
}
// remove the ts file.
...
...
@@ -747,6 +751,12 @@ int SrsHls::reopen()
unlink
(
segment
->
full_path
.
c_str
());
srs_freep
(
segment
);
}
// check ret of refresh m3u8
if
(
ret
!=
ERROR_SUCCESS
)
{
srs_error
(
"refresh m3u8 failed. ret=%d"
,
ret
);
return
ret
;
}
}
// new segment.
current
=
new
SrsM3u8Segment
();
...
...
请
注册
或
登录
后发表评论