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-04-21 16:18:37 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1d973e2178a214149c02e38d9821bc3e9bebe203
1d973e21
1 parent
d19dfa52
refine the overflow algorithm, prevent smaller piece.
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
14 行增加
和
2 行删除
trunk/src/app/srs_app_hls.cpp
trunk/src/main/srs_main_ingest_hls.cpp
trunk/src/app/srs_app_hls.cpp
查看文件 @
1d973e2
...
...
@@ -542,6 +542,11 @@ bool SrsHlsMuxer::is_segment_overflow()
{
srs_assert
(
current
);
// to prevent very small segment.
if
(
current
->
duration
<
2
*
SRS_AUTO_HLS_SEGMENT_MIN_DURATION_MS
)
{
return
false
;
}
// use N% deviation, to smoother.
double
deviation
=
hls_ts_floor
?
SRS_HLS_FLOOR_REAP_PERCENT
*
deviation_ts
*
hls_fragment
:
0.0
;
srs_info
(
"hls: dur=%.2f, tar=%.2f, dev=%.2fms/%dp, frag=%.2f"
,
...
...
@@ -560,6 +565,11 @@ bool SrsHlsMuxer::is_segment_absolutely_overflow()
// @see https://github.com/winlinvip/simple-rtmp-server/issues/151#issuecomment-83553950
srs_assert
(
current
);
// to prevent very small segment.
if
(
current
->
duration
<
2
*
SRS_AUTO_HLS_SEGMENT_MIN_DURATION_MS
)
{
return
false
;
}
// use N% deviation, to smoother.
double
deviation
=
hls_ts_floor
?
SRS_HLS_FLOOR_REAP_PERCENT
*
deviation_ts
*
hls_fragment
:
0.0
;
srs_info
(
"hls: dur=%.2f, tar=%.2f, dev=%.2fms/%dp, frag=%.2f"
,
...
...
trunk/src/main/srs_main_ingest_hls.cpp
查看文件 @
1d973e2
...
...
@@ -871,9 +871,10 @@ int SrsIngestSrsOutput::parse_message_queue()
SrsTsMessage
*
first_ts_msg
=
queue
.
begin
()
->
second
;
SrsTsContext
*
context
=
first_ts_msg
->
channel
->
context
;
bool
cpa
=
context
->
is_pure_audio
();
int
nb_videos
=
0
;
if
(
!
c
ontext
->
is_pure_audio
()
)
{
if
(
!
c
pa
)
{
std
::
multimap
<
int64_t
,
SrsTsMessage
*>::
iterator
it
;
for
(
it
=
queue
.
begin
();
it
!=
queue
.
end
();
++
it
)
{
SrsTsMessage
*
msg
=
it
->
second
;
...
...
@@ -892,7 +893,8 @@ int SrsIngestSrsOutput::parse_message_queue()
}
// parse messages util the last video.
while
((
nb_videos
>
1
||
context
->
is_pure_audio
())
&&
queue
.
size
()
>
0
)
{
while
((
cpa
&&
queue
.
size
()
>
1
)
||
nb_videos
>
1
)
{
srs_assert
(
!
queue
.
empty
());
std
::
multimap
<
int64_t
,
SrsTsMessage
*>::
iterator
it
=
queue
.
begin
();
SrsTsMessage
*
msg
=
it
->
second
;
...
...
请
注册
或
登录
后发表评论