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-26 11:07:45 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1401f2e0ab3549be8fa6bb68c5bf15ea465b15b3
1401f2e0
1 parent
b319e9ff
ignore when sps/pps consumed all frame.
显示空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
11 行增加
和
8 行删除
trunk/src/app/srs_app_mpegts_udp.cpp
trunk/src/kernel/srs_kernel_flv.cpp
trunk/src/app/srs_app_mpegts_udp.cpp
查看文件 @
1401f2e
...
...
@@ -353,6 +353,7 @@ int SrsMpegtsOverUdp::on_ts_video(SrsTsMessage* msg, SrsStream* avs)
int
ibpframe_size
=
avs
->
size
()
-
avs
->
pos
();
// send each frame.
bool
got_sps_pps
=
false
;
while
(
!
avs
->
empty
())
{
char
*
frame
=
NULL
;
int
frame_size
=
0
;
...
...
@@ -369,6 +370,8 @@ int SrsMpegtsOverUdp::on_ts_video(SrsTsMessage* msg, SrsStream* avs)
// for sps
if
(
avc
->
is_sps
(
frame
,
frame_size
))
{
got_sps_pps
=
true
;
std
::
string
sps
;
if
((
ret
=
avc
->
sps_demux
(
frame
,
frame_size
,
sps
))
!=
ERROR_SUCCESS
)
{
return
ret
;
...
...
@@ -388,6 +391,8 @@ int SrsMpegtsOverUdp::on_ts_video(SrsTsMessage* msg, SrsStream* avs)
// for pps
if
(
avc
->
is_pps
(
frame
,
frame_size
))
{
got_sps_pps
=
true
;
std
::
string
pps
;
if
((
ret
=
avc
->
pps_demux
(
frame
,
frame_size
,
pps
))
!=
ERROR_SUCCESS
)
{
return
ret
;
...
...
@@ -405,16 +410,13 @@ int SrsMpegtsOverUdp::on_ts_video(SrsTsMessage* msg, SrsStream* avs)
continue
;
}
// regenerat the ibp frame.
if
(
!
avs
->
empty
())
{
ibpframe
=
avs
->
data
()
+
avs
->
pos
();
ibpframe_size
=
avs
->
size
()
-
avs
->
pos
();
}
else
{
srs_info
(
"mpegts: sps/pps frame consumed."
);
return
ret
;
break
;
}
break
;
// not ibp frame, ignore for already sent.
if
(
got_sps_pps
)
{
srs_info
(
"mpegts: already send the sps/pps."
);
return
ret
;
}
// ibp frame.
...
...
trunk/src/kernel/srs_kernel_flv.cpp
查看文件 @
1401f2e
...
...
@@ -103,6 +103,7 @@ int SrsFlvEncoder::write_header(char flv_header[9])
return
ret
;
}
// previous tag size.
char
pts
[]
=
{
(
char
)
0x00
,
(
char
)
0x00
,
(
char
)
0x00
,
(
char
)
0x00
};
if
((
ret
=
_fs
->
write
(
pts
,
4
,
NULL
))
!=
ERROR_SUCCESS
)
{
return
ret
;
...
...
请
注册
或
登录
后发表评论