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-06-06 22:04:24 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
beb0431746e0ad9c889859c2a38362ad08332207
beb04317
1 parent
2d9f258e
detect the monotonically increase and warn to use mix_correct
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
28 行增加
和
0 行删除
trunk/src/app/srs_app_source.cpp
trunk/src/app/srs_app_source.hpp
trunk/src/app/srs_app_source.cpp
查看文件 @
beb0431
...
...
@@ -900,6 +900,9 @@ SrsSource::SrsSource()
gop_cache
=
new
SrsGopCache
();
aggregate_stream
=
new
SrsStream
();
is_monotonically_increase
=
false
;
last_packet_time
=
0
;
_srs_config
->
subscribe
(
this
);
atc
=
false
;
}
...
...
@@ -1467,6 +1470,15 @@ int SrsSource::on_audio(SrsCommonMessage* shared_audio)
{
int
ret
=
ERROR_SUCCESS
;
// monotically increase detect.
if
(
!
mix_correct
&&
is_monotonically_increase
)
{
if
(
last_packet_time
>
0
&&
shared_audio
->
header
.
timestamp
<
last_packet_time
)
{
is_monotonically_increase
=
false
;
srs_warn
(
"stream not monotonically increase, please open mix_correct."
);
}
}
last_packet_time
=
shared_audio
->
header
.
timestamp
;
// convert shared_audio to msg, user should not use shared_audio again.
// the payload is transfer to msg, and set to NULL in shared_audio.
SrsSharedPtrMessage
msg
;
...
...
@@ -1649,6 +1661,15 @@ int SrsSource::on_video(SrsCommonMessage* shared_video)
{
int
ret
=
ERROR_SUCCESS
;
// monotically increase detect.
if
(
!
mix_correct
&&
is_monotonically_increase
)
{
if
(
last_packet_time
>
0
&&
shared_video
->
header
.
timestamp
<
last_packet_time
)
{
is_monotonically_increase
=
false
;
srs_warn
(
"stream not monotonically increase, please open mix_correct."
);
}
}
last_packet_time
=
shared_video
->
header
.
timestamp
;
// drop any unknown header video.
// @see https://github.com/simple-rtmp-server/srs/issues/421
if
(
!
SrsFlvCodec
::
video_is_acceptable
(
shared_video
->
payload
,
shared_video
->
size
))
{
...
...
@@ -1970,6 +1991,10 @@ int SrsSource::on_publish()
// reset the mix queue.
mix_queue
->
clear
();
// detect the monotonically again.
is_monotonically_increase
=
true
;
last_packet_time
=
0
;
// create forwarders
if
((
ret
=
create_forwarders
())
!=
ERROR_SUCCESS
)
{
srs_error
(
"create forwarders failed. ret=%d"
,
ret
);
...
...
trunk/src/app/srs_app_source.hpp
查看文件 @
beb0431
...
...
@@ -437,6 +437,9 @@ private:
// whether use interlaced/mixed algorithm to correct timestamp.
bool
mix_correct
;
SrsMixQueue
*
mix_queue
;
// whether stream is monotonically increase.
bool
is_monotonically_increase
;
int64_t
last_packet_time
;
// hls handler.
#ifdef SRS_AUTO_HLS
SrsHls
*
hls
;
...
...
请
注册
或
登录
后发表评论