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-03-31 15:54:05 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b9c21b1e8fc3a2783a1bbdd7a9d8aee11aa6c96c
b9c21b1e
1 parent
9be7fbba
enhanced hls, warning when ts dup or jmp.
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
14 行增加
和
1 行删除
trunk/src/app/srs_app_hls.cpp
trunk/src/app/srs_app_hls.hpp
trunk/src/app/srs_app_hls.cpp
查看文件 @
b9c21b1
...
...
@@ -176,6 +176,7 @@ SrsHlsMuxer::SrsHlsMuxer()
hls_fragment
=
hls_window
=
0
;
hls_aof_ratio
=
1.0
;
hls_fragment_deviation
=
0
;
previous_floor_ts
=
0
;
hls_ts_floor
=
false
;
target_duration
=
0
;
_sequence_no
=
0
;
...
...
@@ -242,6 +243,7 @@ int SrsHlsMuxer::update_config(SrsRequest* r, string entry_prefix,
hls_fragment
=
fragment
;
hls_aof_ratio
=
aof_ratio
;
hls_ts_floor
=
ts_floor
;
previous_floor_ts
=
0
;
hls_window
=
window
;
// for the first time, we set to -N% of fragment,
// that is, the first piece always smaller.
...
...
@@ -329,9 +331,17 @@ int SrsHlsMuxer::segment_open(int64_t segment_start_dts)
std
::
string
ts_file
=
hls_ts_file
;
ts_file
=
srs_path_build_stream
(
ts_file
,
req
->
vhost
,
req
->
app
,
req
->
stream
);
if
(
hls_ts_floor
)
{
int64_t
floor_ts
=
(
int64_t
)(
srs_get_system_time_ms
()
/
(
1000
*
hls_fragment
));
std
::
stringstream
ts_floor
;
ts_floor
<<
(
int64_t
)(
srs_get_system_time_ms
()
/
(
1000
*
hls_fragment
))
;
ts_floor
<<
floor_ts
;
ts_file
=
srs_string_replace
(
ts_file
,
"[timestamp]"
,
ts_floor
.
str
());
// dup/jmp detect for ts in floor mode.
if
(
previous_floor_ts
&&
previous_floor_ts
!=
floor_ts
-
1
)
{
srs_warn
(
"hls: dup or jmp for floor ts, previous=%"
PRId64
", current=%"
PRId64
", ts=%s, deviation=%.2f"
,
previous_floor_ts
,
floor_ts
,
ts_file
.
c_str
(),
hls_fragment_deviation
);
}
previous_floor_ts
=
floor_ts
;
}
ts_file
=
srs_path_build_timestamp
(
ts_file
);
if
(
true
)
{
...
...
trunk/src/app/srs_app_hls.hpp
查看文件 @
b9c21b1
...
...
@@ -180,6 +180,9 @@ private:
// the deviation in seconds to adjust the fragment to be more
// bigger or smaller.
double
hls_fragment_deviation
;
// the previous reap floor timestamp,
// used to detect the dup or jmp or ts.
int64_t
previous_floor_ts
;
private
:
int
_sequence_no
;
int
target_duration
;
...
...
请
注册
或
登录
后发表评论