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 11:28:00 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9743e025415b9306a3bebca99c76f1acda8e04f1
9743e025
1 parent
6fe36afc
refine the mix correct algorithm.
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
21 行增加
和
8 行删除
trunk/src/app/srs_app_source.cpp
trunk/src/app/srs_app_source.cpp
查看文件 @
9743e02
...
...
@@ -55,8 +55,8 @@ using namespace std;
// 115 packets is 3s.
#define SRS_PURE_AUDIO_GUESS_COUNT 115
// when got these videos or audios, mix ok.
#define SRS_MIX_CORRECT_MIX_AV 10
// when got these videos or audios, pure audio or video, mix ok.
#define SRS_MIX_CORRECT_PURE_AV 10
int
_srs_time_jitter_string2int
(
std
::
string
time_jitter
)
{
...
...
@@ -849,12 +849,25 @@ void SrsMixQueue::push(SrsSharedPtrMessage* msg)
SrsSharedPtrMessage
*
SrsMixQueue
::
pop
()
{
// when got 10+ videos or audios, mix ok.
// when got 1 video and 1 audio, mix ok.
if
(
nb_videos
<
SRS_MIX_CORRECT_MIX_AV
&&
nb_audios
<
SRS_MIX_CORRECT_MIX_AV
)
{
if
(
nb_videos
<
1
||
nb_audios
<
1
)
{
return
NULL
;
}
bool
mix_ok
=
false
;
// pure video
if
(
nb_videos
>=
SRS_MIX_CORRECT_PURE_AV
&&
nb_audios
==
0
)
{
mix_ok
=
true
;
}
// pure audio
if
(
nb_audios
>=
SRS_MIX_CORRECT_PURE_AV
&&
nb_videos
==
0
)
{
mix_ok
=
true
;
}
// got 1 video and 1 audio, mix ok.
if
(
nb_videos
>=
1
&&
nb_audios
>=
1
)
{
mix_ok
=
true
;
}
if
(
!
mix_ok
)
{
return
NULL
;
}
// pop the first msg.
...
...
请
注册
或
登录
后发表评论