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-04 15:49:24 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
57f844b6364a9920901f198d52dfc9cc5b81d4bd
57f844b6
1 parent
159ef382
for bug #249, simplify the macro, 0 to disable chunk stream cache.
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
8 行增加
和
1 行删除
trunk/src/core/srs_core_performance.hpp
trunk/src/rtmp/srs_protocol_stack.cpp
trunk/src/core/srs_core_performance.hpp
查看文件 @
57f844b
...
...
@@ -75,6 +75,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* how many chunk stream to cache, [0, N].
* to imporove about 10% performance when chunk size small, and 5% for large chunk.
* @see https://github.com/winlinvip/simple-rtmp-server/issues/249
* @remark 0 to disable the chunk stream cache.
*/
#define SRS_PERF_CHUNK_STREAM_CACHE 16
...
...
trunk/src/rtmp/srs_protocol_stack.cpp
查看文件 @
57f844b
...
...
@@ -418,7 +418,10 @@ SrsProtocol::SrsProtocol(ISrsProtocolReaderWriter* io)
warned_c0c3_cache_dry
=
false
;
auto_response_when_recv
=
true
;
cs_cache
=
new
SrsChunkStream
*
[
SRS_PERF_CHUNK_STREAM_CACHE
];
cs_cache
=
NULL
;
if
(
SRS_PERF_CHUNK_STREAM_CACHE
>
0
)
{
cs_cache
=
new
SrsChunkStream
*
[
SRS_PERF_CHUNK_STREAM_CACHE
];
}
for
(
int
cid
=
0
;
cid
<
SRS_PERF_CHUNK_STREAM_CACHE
;
cid
++
)
{
SrsChunkStream
*
cs
=
new
SrsChunkStream
(
cid
);
// set the perfer cid of chunk,
...
...
@@ -1102,6 +1105,9 @@ int SrsProtocol::recv_interlaced_message(SrsMessage** pmsg)
}
srs_verbose
(
"read basic header success. fmt=%d, cid=%d"
,
fmt
,
cid
);
// the cid must not negative.
srs_assert
(
cid
>=
0
);
// once we got the chunk message header,
// that is there is a real message in cache,
// increase the timeout to got it.
...
...
请
注册
或
登录
后发表评论