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:35:39 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d026861e239eb674a076175342477be454ce0208
d026861e
1 parent
4b09531e
for bug #241, simplify the buffer, donot reset when chunk size change.
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
1 行增加
和
34 行删除
trunk/src/rtmp/srs_protocol_buffer.cpp
trunk/src/rtmp/srs_protocol_buffer.hpp
trunk/src/rtmp/srs_protocol_stack.cpp
trunk/src/rtmp/srs_protocol_buffer.cpp
查看文件 @
d026861
...
...
@@ -200,25 +200,6 @@ void SrsFastBuffer::set_merge_read(bool v, int max_buffer, IMergeReadHandler* ha
}
#endif
void
SrsFastBuffer
::
on_chunk_size
(
int32_t
chunk_size
)
{
if
(
nb_buffer
>=
chunk_size
)
{
return
;
}
// limit the max buffer.
int
buffer_size
=
srs_min
(
chunk_size
,
SRS_MR_SOCKET_BUFFER
);
if
(
buffer_size
!=
nb_buffer
)
{
reset_buffer
(
buffer_size
);
}
}
int
SrsFastBuffer
::
buffer_size
()
{
return
nb_buffer
;
}
void
SrsFastBuffer
::
reset_buffer
(
int
size
)
{
// remember the cap.
...
...
trunk/src/rtmp/srs_protocol_buffer.hpp
查看文件 @
d026861
...
...
@@ -163,17 +163,6 @@ public:
*/
virtual
void
set_merge_read
(
bool
v
,
int
max_buffer
,
IMergeReadHandler
*
handler
);
#endif
public
:
/**
* when chunk size changed, the buffer should change the buffer also.
* to keep the socket buffer size always greater than chunk size.
* @see https://github.com/winlinvip/simple-rtmp-server/issues/241
*/
virtual
void
on_chunk_size
(
int32_t
chunk_size
);
/**
* get the size of socket buffer to read.
*/
virtual
int
buffer_size
();
private
:
virtual
void
reset_buffer
(
int
size
);
};
...
...
trunk/src/rtmp/srs_protocol_stack.cpp
查看文件 @
d026861
...
...
@@ -1708,11 +1708,8 @@ int SrsProtocol::on_recv_message(SrsMessage* msg)
SRS_CONSTS_RTMP_MAX_CHUNK_SIZE
);
}
int
sock_buffer
=
in_buffer
->
buffer_size
();
in_chunk_size
=
pkt
->
chunk_size
;
in_buffer
->
on_chunk_size
(
pkt
->
chunk_size
);
srs_trace
(
"input chunk size to %d, sock buf %d=>%d"
,
pkt
->
chunk_size
,
sock_buffer
,
in_buffer
->
buffer_size
());
srs_trace
(
"input chunk size to %d"
,
pkt
->
chunk_size
);
break
;
}
...
...
请
注册
或
登录
后发表评论