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
2014-12-05 22:00:57 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
528ae1e9b15e861f5ad9f723230361825b320624
528ae1e9
1 parent
e80c8603
refine source and queue dump msgs.
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
14 行增加
和
10 行删除
trunk/src/app/srs_app_source.cpp
trunk/src/app/srs_app_source.cpp
查看文件 @
528ae1e
...
...
@@ -211,22 +211,24 @@ int SrsMessageQueue::enqueue(SrsSharedPtrMessage* msg, bool* is_overflow)
int
SrsMessageQueue
::
dump_packets
(
int
max_count
,
SrsMessage
**
pmsgs
,
int
&
count
)
{
int
ret
=
ERROR_SUCCESS
;
if
(
msgs
.
empty
())
{
int
nb_msgs
=
(
int
)
msgs
.
size
();
if
(
nb_msgs
<=
0
)
{
return
ret
;
}
srs_assert
(
max_count
>
0
);
count
=
srs_min
(
max_count
,
(
int
)
msgs
.
size
());
count
=
srs_min
(
max_count
,
nb_msgs
);
SrsSharedPtrMessage
**
omsgs
=
msgs
.
data
();
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
pmsgs
[
i
]
=
msgs
[
i
];
pmsgs
[
i
]
=
o
msgs
[
i
];
}
Srs
Message
*
last
=
msgs
[
count
-
1
];
Srs
SharedPtrMessage
*
last
=
o
msgs
[
count
-
1
];
av_start_time
=
last
->
header
.
timestamp
;
if
(
count
==
(
int
)
msgs
.
size
()
)
{
if
(
count
>=
nb_msgs
)
{
// the pmsgs is big enough and clear msgs at most time.
msgs
.
clear
();
}
else
{
...
...
@@ -1108,9 +1110,11 @@ int SrsSource::on_audio(SrsMessage* __audio)
#endif
// copy to all consumer
if
(
true
)
{
for
(
int
i
=
0
;
i
<
(
int
)
consumers
.
size
();
i
++
)
{
SrsConsumer
*
consumer
=
consumers
.
at
(
i
);
int
nb_consumers
=
(
int
)
consumers
.
size
();
if
(
nb_consumers
>
0
)
{
SrsConsumer
**
pconsumer
=
consumers
.
data
();
for
(
int
i
=
0
;
i
<
nb_consumers
;
i
++
)
{
SrsConsumer
*
consumer
=
pconsumer
[
i
];
SrsSharedPtrMessage
*
copy
=
msg
.
copy
();
if
((
ret
=
consumer
->
enqueue
(
copy
,
atc
,
sample_rate
,
frame_rate
,
jitter_algorithm
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"dispatch the audio failed. ret=%d"
,
ret
);
...
...
请
注册
或
登录
后发表评论