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-11-12 18:41:24 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7cf855f2421f71a7cb47d0e416654efb8a605fc8
7cf855f2
1 parent
95315925
for bug #199, refine the header generate
显示空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
8 行增加
和
12 行删除
trunk/src/rtmp/srs_protocol_stack.cpp
trunk/src/rtmp/srs_protocol_stack.cpp
查看文件 @
7cf855f
...
...
@@ -600,13 +600,15 @@ void SrsProtocol::generate_chunk_header(SrsMessageHeader* mh, bool c0, int* pnbh
// generate the header.
char
*
p
=
cache
;
// timestamp for c0/c3
u_int32_t
timestamp
=
(
u_int32_t
)
mh
->
timestamp
;
if
(
c0
)
{
// write new chunk stream header, fmt is 0
*
p
++
=
0x00
|
(
mh
->
perfer_cid
&
0x3F
);
// chunk message header, 11 bytes
// timestamp, 3bytes, big-endian
u_int32_t
timestamp
=
(
u_int32_t
)
mh
->
timestamp
;
if
(
timestamp
<
RTMP_EXTENDED_TIMESTAMP
)
{
pp
=
(
char
*
)
&
timestamp
;
*
p
++
=
pp
[
2
];
...
...
@@ -633,21 +635,17 @@ void SrsProtocol::generate_chunk_header(SrsMessageHeader* mh, bool c0, int* pnbh
*
p
++
=
pp
[
1
];
*
p
++
=
pp
[
2
];
*
p
++
=
pp
[
3
];
// chunk extended timestamp header, 0 or 4 bytes, big-endian
if
(
timestamp
>=
RTMP_EXTENDED_TIMESTAMP
)
{
pp
=
(
char
*
)
&
timestamp
;
*
p
++
=
pp
[
3
];
*
p
++
=
pp
[
2
];
*
p
++
=
pp
[
1
];
*
p
++
=
pp
[
0
];
}
}
else
{
// write no message header chunk stream, fmt is 3
// @remark, if perfer_cid > 0x3F, that is, use 2B/3B chunk header,
// SRS will rollback to 1B chunk header.
*
p
++
=
0xC0
|
(
mh
->
perfer_cid
&
0x3F
);
}
// for c0
// chunk extended timestamp header, 0 or 4 bytes, big-endian
//
// for c3:
// chunk extended timestamp header, 0 or 4 bytes, big-endian
// 6.1.3. Extended Timestamp
// This field is transmitted only when the normal time stamp in the
...
...
@@ -662,7 +660,6 @@ void SrsProtocol::generate_chunk_header(SrsMessageHeader* mh, bool c0, int* pnbh
// @see: ngx_rtmp_prepare_message
// @see: http://blog.csdn.net/win_lin/article/details/13363699
// TODO: FIXME: extract to outer.
u_int32_t
timestamp
=
(
u_int32_t
)
mh
->
timestamp
;
if
(
timestamp
>=
RTMP_EXTENDED_TIMESTAMP
)
{
pp
=
(
char
*
)
&
timestamp
;
*
p
++
=
pp
[
3
];
...
...
@@ -670,7 +667,6 @@ void SrsProtocol::generate_chunk_header(SrsMessageHeader* mh, bool c0, int* pnbh
*
p
++
=
pp
[
1
];
*
p
++
=
pp
[
0
];
}
}
// always has header
*
pnbh
=
p
-
cache
;
...
...
请
注册
或
登录
后发表评论